diff --git a/tasks/schedule.go b/tasks/schedule.go index aeed88b7..e9a40004 100644 --- a/tasks/schedule.go +++ b/tasks/schedule.go @@ -83,9 +83,9 @@ func scheduleHourly(name RecurringTaskName, workFn RecurringTaskFn) { recurDoneChs[name] = ch go func() { defer func() { - close(ch) recurLock.Lock() defer recurLock.Unlock() + close(ch) if recurDoneChs[name] == ch { delete(recurDoneChs, name) }