Skip to content

Commit

Permalink
fix(): support processors registered with useFactory/useValue
Browse files Browse the repository at this point in the history
Closes #691
  • Loading branch information
micalevisk committed Oct 15, 2021
1 parent 26c1606 commit 4420873
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/bull.explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,22 @@ export class BullExplorer implements OnModuleInit {
const providers: InstanceWrapper[] = this.discoveryService
.getProviders()
.filter((wrapper: InstanceWrapper) =>
this.metadataAccessor.isQueueComponent(wrapper.metatype),
this.metadataAccessor.isQueueComponent(
wrapper.inject || !wrapper.metatype
? wrapper.instance?.constructor
: wrapper.metatype,
),
);

providers.forEach((wrapper: InstanceWrapper) => {
const { instance, metatype } = wrapper;
const isRequestScoped = !wrapper.isDependencyTreeStatic();
const {
name: queueName,
} = this.metadataAccessor.getQueueComponentMetadata(metatype);
} =
this.metadataAccessor.getQueueComponentMetadata(
instance.constructor || metatype,
);

const queueToken = getQueueToken(queueName);
const bullQueue = this.getQueue(queueToken, queueName);
Expand Down

0 comments on commit 4420873

Please sign in to comment.