Bullmq retry completed jobs manually
Asked Answered
E

1

6

I'm using bullmq to send webhooks events. Jobs are scheduled and an automatic retry is in place. Let's say I want to re-execute some tasks which already successfully completed and I have the ids of the elements in the queue I want to reschedule, is it possible to set those task as "to repeat" manually by moving them in the waiting queue somehow with redis?

Excruciating answered 1/3, 2021 at 15:1 Comment(0)
S
0

That's what the retry method is for, no?

(method) Job<any, any, string>.retry(state?: FinishedStatus): Promise

Attempts to retry the job. Only a job that has failed or completed can be retried.

@param state — completed / failed

@returns If resolved and return code is 1, then the queue emits a waiting event otherwise the operation was not a success and throw the corresponding error. If the promise rejects, it indicates that the script failed to execute

Semblance answered 20/10, 2024 at 17:19 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.