File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
packages/api/src/queueAdapters Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 11import { Job , Queue } from 'bull' ;
2+ import BullQueue from 'bull' ;
23import {
34 JobCleanStatus ,
45 JobCounts ,
@@ -13,6 +14,10 @@ import { BaseAdapter } from './base';
1314export class BullAdapter extends BaseAdapter {
1415 constructor ( public queue : Queue , options : Partial < QueueAdapterOptions > = { } ) {
1516 super ( 'bull' , { ...options , allowCompletedRetries : false } ) ;
17+
18+ if ( ! ( queue instanceof BullQueue ) ) {
19+ throw new Error ( `You've used the Bull adapter with a non-Bull queue.` ) ;
20+ }
1621 }
1722
1823 public getRedisInfo ( ) : Promise < string > {
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ import { BaseAdapter } from './base';
1313export class BullMQAdapter extends BaseAdapter {
1414 constructor ( private queue : Queue , options : Partial < QueueAdapterOptions > = { } ) {
1515 super ( 'bullmq' , options ) ;
16+ if ( ! ( queue instanceof Queue ) ) {
17+ throw new Error ( `You've used the BullMQ adapter with a non-BullMQ queue.` ) ;
18+ }
1619 }
1720
1821 public async getRedisInfo ( ) : Promise < string > {
You can’t perform that action at this time.
0 commit comments