From c435d231ab687cf80afb5af3f03f6e71eea49ab2 Mon Sep 17 00:00:00 2001 From: Anker Jam Date: Mon, 5 Oct 2020 10:38:14 +0800 Subject: [PATCH] complete check --- pkg/task/task.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/task/task.go b/pkg/task/task.go index a781e47a..e76706e3 100644 --- a/pkg/task/task.go +++ b/pkg/task/task.go @@ -548,13 +548,20 @@ func(m *taskManager) DeleteTask(taskname string) { // ClearTask clear all tasks func(m *taskManager) ClearTask() { + isChanged := false + m.taskLock.Lock() m.adminTaskList = make(map[string]Tasker) + if m.started { + isChanged = true + } m.taskLock.Unlock() - go func() { - m.changed <- true - }() + if isChanged { + go func() { + m.changed <- true + }() + } } // MapSorter sort map for tasker