mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-26 16:57:08 +00:00
chore: apply config when geo update
This commit is contained in:
18
main.go
18
main.go
@@ -113,9 +113,23 @@ func main() {
|
||||
}
|
||||
|
||||
if C.GeoAutoUpdate {
|
||||
updater.RegisterGeoUpdater()
|
||||
}
|
||||
updateNotification := make(chan struct{})
|
||||
go updater.RegisterGeoUpdater(updateNotification)
|
||||
|
||||
go func() {
|
||||
for range updateNotification {
|
||||
cfg, err := executor.ParseWithPath(C.Path.Config())
|
||||
if err != nil {
|
||||
log.Errorln("[GEO] update GEO databases failed: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
log.Warnln("[GEO] update GEO databases success, applying config")
|
||||
|
||||
executor.ApplyConfig(cfg, false)
|
||||
}
|
||||
}()
|
||||
}
|
||||
defer executor.Shutdown()
|
||||
|
||||
termSign := make(chan os.Signal, 1)
|
||||
|
||||
Reference in New Issue
Block a user