Skip to content

multiple jobs based on same file #225

Answered by mattador1
mattador1 asked this question in Q&A
Discussion options

You must be logged in to vote

Until I post the question only then I find the answer :)
Found it, so basically name of the job should be different but path should point to same file.

await bree.add({
name: "test1",
path: path.join(__dirname, "jobs", "Status.job.ts"),
timeout: "3s",
interval: "10s",
worker: {
name: "worker1",
workerData: {
data: "my data1"
},
},
});

await bree.add({
  name: "test2",
  path: path.join(__dirname, "jobs", "Status.job.ts"),
  timeout: "4s",
  interval: "10s",
  worker: {
    name: "worker2",
    workerData: {
           data: "my data2"
    },
  },
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mattador1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant