1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 09:10:55 +00:00

dynamically add task

This commit is contained in:
Yumin Wu 2018-11-12 17:17:06 +08:00
parent 053a075344
commit 2d6f1af1a5

View File

@ -446,6 +446,7 @@ func StopTask() {
// AddTask add task with name // AddTask add task with name
func AddTask(taskname string, t Tasker) { func AddTask(taskname string, t Tasker) {
t.SetNext(time.Now().Local())
AdminTaskList[taskname] = t AdminTaskList[taskname] = t
if isstart { if isstart {
changed <- true changed <- true