|
|
|
|
|
by scarboy
4368 days ago
|
|
Not sure if it was your intention, but your weekly update case will reset every time there is a manual update. I avoid time.After for recurring tasks in a select loop for this reason. time.Ticker is great if you want to repeat the task at approximately the same interval. time.Timer is what I use when I want the task to repeat a certain time after the previous task has finished. You can also conveniently use timer.Reset(0) to trigger an immediate tick. |
|
`time.Ticker` looks handy, I will definitely use it for another project.