1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-24 14:30:54 +00:00

complete check

This commit is contained in:
Anker Jam 2020-10-05 10:38:14 +08:00
parent b838683731
commit c435d231ab

View File

@ -548,13 +548,20 @@ func(m *taskManager) DeleteTask(taskname string) {
// ClearTask clear all tasks // ClearTask clear all tasks
func(m *taskManager) ClearTask() { func(m *taskManager) ClearTask() {
isChanged := false
m.taskLock.Lock() m.taskLock.Lock()
m.adminTaskList = make(map[string]Tasker) m.adminTaskList = make(map[string]Tasker)
if m.started {
isChanged = true
}
m.taskLock.Unlock() m.taskLock.Unlock()
if isChanged {
go func() { go func() {
m.changed <- true m.changed <- true
}() }()
}
} }
// MapSorter sort map for tasker // MapSorter sort map for tasker