diff --git a/core/executors/periodicalexecutor.go b/core/executors/periodicalexecutor.go index a6d8c382..7db54a5d 100644 --- a/core/executors/periodicalexecutor.go +++ b/core/executors/periodicalexecutor.go @@ -139,9 +139,7 @@ func (pe *PeriodicalExecutor) executeTasks(tasks interface{}) bool { pe.wgBarrier.Guard(func() { pe.waitGroup.Add(1) }) - defer pe.wgBarrier.Guard(func() { - pe.waitGroup.Done() - }) + defer pe.waitGroup.Done() ok := pe.hasTasks(tasks) if ok {