mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-23 17:31:11 +01:00
重构msg的包
This commit is contained in:
17
backend/services/msg_handler/msg_task.go
Normal file
17
backend/services/msg_handler/msg_task.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package msg_handler
|
||||
|
||||
import (
|
||||
"crawlab/constants"
|
||||
"crawlab/utils"
|
||||
)
|
||||
|
||||
type Task struct {
|
||||
msg NodeMessage
|
||||
}
|
||||
|
||||
func (t *Task) Handle() error {
|
||||
// 取消任务
|
||||
ch := utils.TaskExecChanMap.ChanBlocked(t.msg.TaskId)
|
||||
ch <- constants.TaskCancel
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user