fix panic reset tiker
This commit is contained in:
parent
8290f5c880
commit
337fa4607a
@ -36,6 +36,9 @@ func (wc *DataUpdater) Start(ctx context.Context) {
|
|||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
wc.processTasks(ctx)
|
wc.processTasks(ctx)
|
||||||
nextStart = calculateTime()
|
nextStart = calculateTime()
|
||||||
|
if nextStart <= 0 {
|
||||||
|
nextStart = 86400
|
||||||
|
}
|
||||||
ticker.Reset(time.Second * time.Duration(nextStart))
|
ticker.Reset(time.Second * time.Duration(nextStart))
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user