fix panic reset tiker

This commit is contained in:
Pavel 2024-05-20 12:26:21 +03:00
parent 8290f5c880
commit 337fa4607a

@ -36,6 +36,9 @@ func (wc *DataUpdater) Start(ctx context.Context) {
case <-ticker.C:
wc.processTasks(ctx)
nextStart = calculateTime()
if nextStart <= 0 {
nextStart = 86400
}
ticker.Reset(time.Second * time.Duration(nextStart))
case <-ctx.Done():
return