2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-10-24 10:36:12 +08:00

chore(): 设置jobId 为cmdb的instanceId

This commit is contained in:
pacinochen
2022-03-07 15:54:36 +08:00
parent b345b237c7
commit 21d91a1313
14 changed files with 94 additions and 90 deletions

View File

@@ -22,6 +22,9 @@ type Task struct {
// typename indicates the type of task to be performed.
typename string
// 任务ID,用于asynq维护自己的任务map
taskId string
// payload holds data needed to perform the task.
payload []byte
@@ -43,9 +46,10 @@ func (t *Task) ResultWriter() *ResultWriter { return t.w }
// NewTask returns a new Task given a type name and payload data.
// Options can be passed to configure task processing behavior.
func NewTask(typename string, payload []byte, opts ...Option) *Task {
func NewTask(typename, taskId string, payload []byte, opts ...Option) *Task {
return &Task{
typename: typename,
taskId: taskId,
payload: payload,
opts: opts,
}