mirror of
https://github.com/cedar2025/hysteria.git
synced 2025-06-08 05:19:56 +00:00
feat: load previous download when download fail
This commit is contained in:
parent
6dea0adb19
commit
842b0ab3f7
@ -119,9 +119,12 @@ func (l *GeoLoader) LoadGeoIP() (map[string]*v2geo.GeoIP, error) {
|
|||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// as long as the previous download exists, fallback to it
|
||||||
|
if _, serr := os.Stat(filename); os.IsNotExist(serr) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
m, err := v2geo.LoadGeoIP(filename)
|
m, err := v2geo.LoadGeoIP(filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -154,9 +157,12 @@ func (l *GeoLoader) LoadGeoSite() (map[string]*v2geo.GeoSite, error) {
|
|||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// as long as the previous download exists, fallback to it
|
||||||
|
if _, serr := os.Stat(filename); os.IsNotExist(serr) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
m, err := v2geo.LoadGeoSite(filename)
|
m, err := v2geo.LoadGeoSite(filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user