Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle specified Job Event #165

Closed
callmez opened this issue Sep 10, 2019 · 1 comment
Closed

Handle specified Job Event #165

callmez opened this issue Sep 10, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@callmez
Copy link
Contributor

callmez commented Sep 10, 2019

Hi @fwoelffel , it would be nice if we can handle specified job event by job name or ID.

import {
  Processor,
  Process,
  OnQueueFailed,
  OnGlobalQueueFailed,
} from 'nest-bull';

import { Job } from 'bull';

@Processor({ name: 'default_queue' })
export class TestQueue {
  @Process({ name: 'test' })
  processTest(job: Job) {}

  @OnQueueFailed({ name: 'test' })
  onTestError() {}
  // ...

  @OnGlobalQueueFailed()
  onGlobalError() {}
}
@fwoelffel
Copy link
Contributor

Hi @callmez

Unfortunately this feature isn't shipped with bull. However, I believe it can be achieved by changing https://github.com/nestjsx/nest-bull/blob/dev/lib/bull.explorer.ts#L81
I haven't thought about performance implications, so we should be cautious with this.

Feel free to submit a PR. I currently don't have the time to work on this feature but it might also be useful to others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants