You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use multiple queues to structure my task flow. For example, if a task consists of two actions, I split the task into two queues: Queue A and Queue B. After an HTTP request, a job is created in Queue A. When Queue A completes, a new task is created in Queue B. This works fine during development. However, when I attempt to run multiple threads using PM2 in cluster mode, there is an issue. In Step 1, only one Node instance responds to my HTTP request and creates a task in Queue A, which is expected. But in the completion event of Queue A, BullMQ has multiple workers listening simultaneously, leading to multiple tasks being created in Queue B, which I want to avoid. How can I solve this problem?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I use multiple queues to structure my task flow. For example, if a task consists of two actions, I split the task into two queues: Queue A and Queue B. After an HTTP request, a job is created in Queue A. When Queue A completes, a new task is created in Queue B. This works fine during development. However, when I attempt to run multiple threads using PM2 in cluster mode, there is an issue. In Step 1, only one Node instance responds to my HTTP request and creates a task in Queue A, which is expected. But in the completion event of Queue A, BullMQ has multiple workers listening simultaneously, leading to multiple tasks being created in Queue B, which I want to avoid. How can I solve this problem?
Beta Was this translation helpful? Give feedback.
All reactions