File tree 1 file changed +13
-11
lines changed
1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -229,20 +229,22 @@ func UpdateGeoDatabases() error {
229
229
}
230
230
231
231
func getUpdateTime () (err error , time time.Time ) {
232
- var fileInfo os.FileInfo
233
- if geodata .GeodataMode () {
234
- fileInfo , err = os .Stat (C .Path .GeoIP ())
235
- if err != nil {
236
- return err , time
237
- }
238
- } else {
239
- fileInfo , err = os .Stat (C .Path .MMDB ())
240
- if err != nil {
241
- return err , time
232
+ filesToCheck := []string {
233
+ C .Path .GeoIP (),
234
+ C .Path .MMDB (),
235
+ C .Path .ASN (),
236
+ C .Path .GeoSite (),
237
+ }
238
+
239
+ for _ , file := range filesToCheck {
240
+ var fileInfo os.FileInfo
241
+ fileInfo , err = os .Stat (file )
242
+ if err == nil {
243
+ return nil , fileInfo .ModTime ()
242
244
}
243
245
}
244
246
245
- return nil , fileInfo . ModTime ()
247
+ return
246
248
}
247
249
248
250
func RegisterGeoUpdater () {
You can’t perform that action at this time.
0 commit comments