-
I have dynamic string array which is fetched when initalizing Bree, is it possible to generate jobs based on same job file, but that each job has different inital workerData set (set from string array). So that I can read it inside job. All this jobs should start at the same time, only thing different is inital workerData. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Until I post the question only then I find the answer :) await bree.add({
|
Beta Was this translation helpful? Give feedback.
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"
},
},
});