diff --git a/task/task.go b/task/task.go index 8f25a0f3..00cbbfa7 100644 --- a/task/task.go +++ b/task/task.go @@ -452,9 +452,11 @@ func (m *taskManager) StartTask() { func (m *taskManager) run() { now := time.Now().Local() + m.taskLock.Lock() for _, t := range m.adminTaskList { t.SetNext(nil, now) } + m.taskLock.Unlock() for { // we only use RLock here because NewMapSorter copy the reference, do not change any thing