job complete event is missing after pause/resume
- Dominant language
- JavaScript
- Stars
- 9.4k
- Forks
- 858
- PR merge metrics
- No merged PRs in 30d
Description
Hi everybody.
If I run this code
```
var concurrency=1
mainq.process('myjob', concurrency, function(job,ctx,done) {
ctx.pause( 50000, function(err){
console.log("Worker is paused... ");
setTimeout( function(){ ctx.resume(); }, 10000 );
});
setTimeout( function() { done(); }, 2000 );
});
```
I correctly receive the "job complete" events when I set the callback listener with ` mainq.on("job complete', my_complete_callback)`. However, if I set concurrency to any value greater than 1, my_complete_callback is not always called and some jobs remain stucked in "active" state.
Is it a bug? Did I forget something?
Thank you
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the example with concurrency greater than 1, using the process callback, ctx.pause/resume, and job complete listener shown in the issue. Trace how paused jobs are resumed and completed, then verify that every completed job emits the event and no job remains active.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100