mirror of
https://github.com/MetaCubeX/Clash.Meta.git
synced 2025-04-05 14:13:30 +03:00
fix: 更新错误时未停止后续流程,日志修改
This commit is contained in:
parent
a71fd3b4df
commit
527a602eba
2 changed files with 7 additions and 2 deletions
|
@ -59,7 +59,7 @@ func (f *fetcher) Initial() (any, error) {
|
|||
isLocal = true
|
||||
if f.interval != 0 && modTime.Add(f.interval).Before(time.Now()) {
|
||||
defer func() {
|
||||
log.Infoln("[Provider] %s's proxies not updated for a long time")
|
||||
log.Infoln("[Provider] %s's proxies not updated for a long time, force refresh", f.Name())
|
||||
go f.update()
|
||||
}()
|
||||
}
|
||||
|
@ -160,11 +160,14 @@ func (f *fetcher) update() (same bool, err error) {
|
|||
elm, same, err := f.Update()
|
||||
if err != nil {
|
||||
log.Warnln("[Provider] %s pull error: %s", f.Name(), err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
if same {
|
||||
log.Debugln("[Provider] %s's proxies doesn't change", f.Name())
|
||||
return
|
||||
}
|
||||
|
||||
if f.onUpdate != nil {
|
||||
f.onUpdate(elm)
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ func (f *fetcher) Initial() (interface{}, error) {
|
|||
hasLocal = true
|
||||
if f.interval != 0 && modTime.Add(f.interval).Before(time.Now()) {
|
||||
defer func() {
|
||||
log.Infoln("[Provider] %s's rules not updated for a long time", f.Name())
|
||||
log.Infoln("[Provider] %s's rules not updated for a long time, force refresh", f.Name())
|
||||
go f.update()
|
||||
}()
|
||||
}
|
||||
|
@ -186,10 +186,12 @@ func (f *fetcher) update() (same bool, err error) {
|
|||
elm, same, err := f.Update()
|
||||
if err != nil {
|
||||
log.Warnln("[Provider] %s pull error: %s", f.Name(), err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
if same {
|
||||
log.Debugln("[Provider] %s's rules doesn't change", f.Name())
|
||||
return
|
||||
}
|
||||
|
||||
log.Infoln("[Provider] %s's rules update", f.Name())
|
||||
|
|
Loading…
Add table
Reference in a new issue