mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 08:16:39 +00:00
reduce log level of scheduler to trace
This commit is contained in:
@@ -95,18 +95,18 @@ func (wm *DefaultScheduler) Schedule(in time.Duration, ID string, job func() (ne
|
|||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
select {
|
select {
|
||||||
case <-cancel:
|
case <-cancel:
|
||||||
log.Debugf("scheduled job %s was canceled, stop timer", ID)
|
log.Tracef("scheduled job %s was canceled, stop timer", ID)
|
||||||
ticker.Stop()
|
ticker.Stop()
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
log.Debugf("time to do a scheduled job %s", ID)
|
log.Tracef("time to do a scheduled job %s", ID)
|
||||||
}
|
}
|
||||||
runIn, reschedule := job()
|
runIn, reschedule := job()
|
||||||
if !reschedule {
|
if !reschedule {
|
||||||
wm.mu.Lock()
|
wm.mu.Lock()
|
||||||
defer wm.mu.Unlock()
|
defer wm.mu.Unlock()
|
||||||
delete(wm.jobs, ID)
|
delete(wm.jobs, ID)
|
||||||
log.Debugf("job %s is not scheduled to run again", ID)
|
log.Tracef("job %s is not scheduled to run again", ID)
|
||||||
ticker.Stop()
|
ticker.Stop()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ func (wm *DefaultScheduler) Schedule(in time.Duration, ID string, job func() (ne
|
|||||||
ticker.Reset(runIn)
|
ticker.Reset(runIn)
|
||||||
}
|
}
|
||||||
case <-cancel:
|
case <-cancel:
|
||||||
log.Debugf("job %s was canceled, stopping timer", ID)
|
log.Tracef("job %s was canceled, stopping timer", ID)
|
||||||
ticker.Stop()
|
ticker.Stop()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user