diff --git a/src/api/notifications/notifications.controller.ts b/src/api/notifications/notifications.controller.ts index 00d89bf7b..d6a7b9901 100644 --- a/src/api/notifications/notifications.controller.ts +++ b/src/api/notifications/notifications.controller.ts @@ -83,19 +83,19 @@ enum NotificationDispatchStatusField { @ApiTags('notification') @Roles(Role.Admin, Role.SuperAdmin, Role.AuthenticatedUser) export class NotificationsController { - readonly appConfig; - readonly handleBounce; - readonly guaranteedBroadcastPushDispatchProcessing; - readonly broadcastSubscriberChunkSize; - readonly logSkippedBroadcastPushDispatches; - readonly inboundSmtpServerDomain; - readonly handleListUnsubscribeByEmail; + private readonly appConfig; + private readonly handleBounce; + private readonly guaranteedBroadcastPushDispatchProcessing; + private readonly broadcastSubscriberChunkSize; + private readonly logSkippedBroadcastPushDispatches; + private readonly inboundSmtpServerDomain; + private readonly handleListUnsubscribeByEmail; constructor( private readonly notificationsService: NotificationsService, private readonly subscriptionsService: SubscriptionsService, - readonly appConfigService: AppConfigService, - readonly configurationsService: ConfigurationsService, + private readonly appConfigService: AppConfigService, + private readonly configurationsService: ConfigurationsService, private readonly bouncesService: BouncesService, private readonly commonService: CommonService, @Inject(REQUEST) private readonly req: Request & { user: UserProfile }, @@ -105,8 +105,6 @@ export class NotificationsController { this.handleBounce = this.appConfig.email?.bounce?.enabled; this.guaranteedBroadcastPushDispatchProcessing = this.appConfig.notification?.guaranteedBroadcastPushDispatchProcessing; - const ft = this.appConfig.notification?.broadcastCustomFilterFunctions; - this.broadcastSubscriberChunkSize = this.appConfig.notification?.broadcastSubscriberChunkSize; this.logSkippedBroadcastPushDispatches = @@ -116,6 +114,7 @@ export class NotificationsController { this.handleListUnsubscribeByEmail = this.appConfig.email?.listUnsubscribeByEmail?.enabled; + const ft = this.appConfig.notification?.broadcastCustomFilterFunctions; if (ft) { this.jmespathSearchOpts.functionTable = ft; } diff --git a/src/common/common.service.ts b/src/common/common.service.ts index 1bfab3c32..41779dd95 100644 --- a/src/common/common.service.ts +++ b/src/common/common.service.ts @@ -63,10 +63,6 @@ export class CommonService { const queuedID = []; // IMPORTANT: place queueEvents.on before myQueue.add queueEvents.on('completed', async ({ jobId }) => { - Logger.debug( - `job ${jobId} completed on queueEventsListener for ${j?.id}`, - CommonService.name, - ); if (!j?.id) { queuedID.push(jobId); return; @@ -74,6 +70,10 @@ export class CommonService { if (jobId !== j?.id) { return; } + Logger.debug( + `job ${jobId} completed on queueEventsListener for ${j?.id}`, + CommonService.name, + ); try { resolve(await fn.apply(this, args)); } catch (ex) {