NewRunPatchRetryTask creates a run_patch task with a custom task ID so that re-queuing an offline run does not collide with the still-active original task.
(p RunPatchPayload, taskID string)
| 150 | // NewRunPatchRetryTask creates a run_patch task with a custom task ID so that |
| 151 | // re-queuing an offline run does not collide with the still-active original task. |
| 152 | func NewRunPatchRetryTask(p RunPatchPayload, taskID string) (*asynq.Task, error) { |
| 153 | payload, err := json.Marshal(p) |
| 154 | if err != nil { |
| 155 | return nil, err |
| 156 | } |
| 157 | opts := []asynq.Option{ |
| 158 | asynq.Queue(QueuePatching), |
| 159 | asynq.MaxRetry(10), |
| 160 | asynq.TaskID(taskID), |
| 161 | } |
| 162 | return asynq.NewTask(TypeRunPatch, payload, opts...), nil |
| 163 | } |
| 164 | |
| 165 | // NewUpdateThresholdMonitorTask creates an update-threshold-monitor task. |
| 166 | func NewUpdateThresholdMonitorTask(host string) (*asynq.Task, error) { |