Skip to content

Commit

Permalink
fix: allow usage of bullmq-pro, closes #849
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed Nov 13, 2024
1 parent b00834d commit 9f294ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/api/src/queueAdapters/bullMQ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import { BaseAdapter } from './base';

export class BullMQAdapter extends BaseAdapter {
constructor(private queue: Queue, options: Partial<QueueAdapterOptions> = {}) {
super('bullmq', options);
if (!(queue instanceof Queue)) {
const libName = 'bullmq';
super(libName, options);
if (!(queue.metaValues?.version as string).startsWith(libName)) {
throw new Error(`You've used the BullMQ adapter with a non-BullMQ queue.`);
}
}
Expand Down

0 comments on commit 9f294ae

Please sign in to comment.