MCPcopy Create free account
hub / github.com/PatchMon/PatchMon / NewRunPatchRetryTask

Function NewRunPatchRetryTask

server-source-code/internal/queue/jobs.go:152–163  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
152func 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.
166func NewUpdateThresholdMonitorTask(host string) (*asynq.Task, error) {

Callers 1

ProcessTaskMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected