diff --git a/backend/app/api/app.go b/backend/app/api/app.go index a84b9ae..0f44297 100644 --- a/backend/app/api/app.go +++ b/backend/app/api/app.go @@ -37,8 +37,11 @@ func new(conf *config.Config) *app { } func (a *app) startBgTask(t time.Duration, fn func()) { + timer := time.NewTimer(t) + for { + timer.Reset(t) a.server.Background(fn) - time.Sleep(t) + <-timer.C } }