Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry does not work with flows #1148

Closed
mravey opened this issue Mar 21, 2022 · 2 comments
Closed

Retry does not work with flows #1148

mravey opened this issue Mar 21, 2022 · 2 comments
Labels
question Further information is requested

Comments

@mravey
Copy link

mravey commented Mar 21, 2022

It looks like retries do not work with Flow. I have a queue with defaultJobOptions.attemps = 4, it does retry with a normal job but not with a job that is part of a flow.
Here is code to reproduce the issue:

const { Queue, Worker, QueueScheduler, FlowProducer } = require("bullmq");

const myQueue = new Queue("test_bull", {
  defaultJobOptions: {
    attempts: 4,
    backoff: {
      type: "exponential",
      delay: 1000,
    },
  },
});

new QueueScheduler("test_bull");

const producer = new FlowProducer();

const addJob = async () => {
  // await myQueue.add("my_job");

  await producer.add({
    name: "my_parent_job",
    queueName: "test_bull",
    children: [
      {
        name: "my_job",
        queueName: "test_bull",
      },
    ],
  });
};

addJob().catch(console.log);

const w = new Worker("test_bull", async (job) => {
  console.log(job.id, job.data);

  throw new Error("TODO");
});

w.on("failed", (job) => {
  console.log(`job failed ${job.id}`);
});
@roggervalf
Copy link
Collaborator

hi @mravey, you should probably need to check https://docs.bullmq.io/guide/flows#provide-options

@roggervalf roggervalf added the question Further information is requested label Mar 22, 2022
@abarbosa-godaddy
Copy link

Hey guys. Is it possible to retry a flow? Either partially or complete? I have a flow and if one of the children fails I would like to retry the failed one and continue the flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants