1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-25 20:30:50 +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
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