Fix pg-boss worker not working with dynamic injection (#6119)

This commit is contained in:
Charles Bochet
2024-07-03 19:17:29 +02:00
committed by GitHub
parent c57c5b2554
commit 4c57e838ca
2 changed files with 3 additions and 5 deletions

View File

@ -156,7 +156,7 @@ export class MessageQueueExplorer implements OnModuleInit {
}),
);
if (isRequestScoped && job.data) {
if (isRequestScoped) {
const contextId = createContextId();
if (this.moduleRef.registerRequestByContextId) {
@ -164,7 +164,7 @@ export class MessageQueueExplorer implements OnModuleInit {
{
// Add workspaceId to the request object
req: {
workspaceId: job.data.workspaceId,
workspaceId: job.data?.workspaceId,
},
},
contextId,