Fix timer going awry

This commit is contained in:
Deluan
2023-01-17 22:04:04 -05:00
parent feb774a149
commit 580e9ae4bd
5 changed files with 14 additions and 21 deletions
+2 -1
View File
@@ -65,10 +65,11 @@ func (a *cacheWarmer) sendWakeSignal() {
func (a *cacheWarmer) run(ctx context.Context) {
for {
time.AfterFunc(10*time.Second, func() {
t := time.AfterFunc(10*time.Second, func() {
a.sendWakeSignal()
})
<-a.wakeSignal
t.Stop()
// If cache not available, keep waiting
if !a.cache.Available(ctx) {