How to determince the number of workers to be assigned to jobs in queue #2297
Unanswered
elhananjair
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello friends,
I am new to the queue systems in general, recently I have been working on a simple project. I have two main jobs that get executed in the background, and I scheduled it to a different time that repeats itself daily at a specific time.
I created one queue like this and add job to it.
``
const queue = new Queue('bg_process');
await queue.add('first_job', { intv: 3 });
await queue.add('second_job', { intv: 4 });
const worker = new Worker('math', async (job) => {
if (job.name === 'first_job') {
console.log(job.data)
} else if (job.name === 'second.job') {
console.log(job.data)
}
});
Beta Was this translation helpful? Give feedback.
All reactions