mirror of
https://github.com/astaxie/beego.git
synced 2024-11-24 14:30:54 +00:00
complete check
This commit is contained in:
parent
b838683731
commit
c435d231ab
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user