bull icon indicating copy to clipboard operation
bull copied to clipboard

Named jobs failure handling

Open mjgp2 opened this issue 5 years ago • 4 comments

I'm submitting a...


[ ] Regression 
[ ] Bug report
[ x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Currently, failure handling in queues requires switch statements on the job name inside the method decorated with @OnQueueFailed - it would be preferable to be able to specify a job name as you can in @Process for failure handling and have a method to handle failure for each named job.

mjgp2 avatar Jan 28 '20 11:01 mjgp2

Just started using and I think you can ref name in the onQueueFailed.

The following works for me as expected:

@Process('install-application')
async installApplication(job: Job) { ... }

@OnQueueFailed({ name: 'install-application' })
async installApplicationFailed(job: Job) { ... }

@Process('uninstall-application')
async uninstallApplication(job: Job) { ... }

@OnQueueFailed({ name: 'uninstall-application' })
async uninstallApplicationFailed(job: Job) { ... }

tjhiggins avatar Dec 22 '20 15:12 tjhiggins

what are the events for a single queue job failed and at the end the whole queue was done? TIA

mahmed0715 avatar Apr 07 '21 03:04 mahmed0715

I have the same problem

liangwei0101 avatar Sep 17 '21 07:09 liangwei0101

I have the same problem. I cannot find api docs, where I can read about types (Typescript), so I don't know what "name" exectly means in options of event decorators. I try to use @OnQueueCompleted({ name: 'something' }), and whatever I put on "name" in options, method doesn't work. Without options it works, where i can filter job by name using switch/if statements.

yafimchik avatar Nov 20 '21 11:11 yafimchik