Skip to content

Commit

Permalink
fix: support for older BullMQ versions, round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed Nov 15, 2024
1 parent c72b28c commit 1634438
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/api/src/queueAdapters/bullMQ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export class BullMQAdapter extends BaseAdapter {
constructor(private queue: Queue, options: Partial<QueueAdapterOptions> = {}) {
const libName = 'bullmq';
super(libName, options);
if (!(queue instanceof Queue) || !(queue.metaValues?.version as string)?.startsWith(libName)) {
if (
!(queue instanceof Queue || `${(queue as Queue).metaValues?.version}`?.startsWith(libName))
) {
throw new Error(`You've used the BullMQ adapter with a non-BullMQ queue.`);
}
}
Expand Down

0 comments on commit 1634438

Please sign in to comment.