From 2852bbf2f18a20fa6bb1453fb32b89a0cbce5cb0 Mon Sep 17 00:00:00 2001 From: Mayur Date: Mon, 23 Dec 2024 11:47:54 +0530 Subject: [PATCH 1/2] feat: Removed the duplicate condition --- .../usecase/auto-import-jobs-schedular.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/apps/api/src/app/auto-import-jobs-schedular/usecase/auto-import-jobs-schedular.ts b/apps/api/src/app/auto-import-jobs-schedular/usecase/auto-import-jobs-schedular.ts index 60641a37..1e75ec1c 100644 --- a/apps/api/src/app/auto-import-jobs-schedular/usecase/auto-import-jobs-schedular.ts +++ b/apps/api/src/app/auto-import-jobs-schedular/usecase/auto-import-jobs-schedular.ts @@ -46,13 +46,6 @@ export class AutoImportJobsSchedular { } async scheduleUpdateNextRun(userJobId: string, nextRunSchedule: dayjs.Dayjs, endsOn: dayjs.Dayjs) { - await this.userJobRepository.findOneAndUpdate( - { _id: userJobId }, - { - $set: { nextRun: nextRunSchedule.toDate() }, - }, - { new: true } - ); const nextRunValue = dayjs(nextRunSchedule).isAfter(endsOn) && endsOn ? undefined : nextRunSchedule; await this.userJobRepository.update({ _id: userJobId }, { $set: { nextRun: nextRunValue } }); From 4ec2ebece73289254a19e4450841c80ffdb51f46 Mon Sep 17 00:00:00 2001 From: Mayur Date: Mon, 23 Dec 2024 12:14:46 +0530 Subject: [PATCH 2/2] feat: Added condition --- .../usecase/auto-import-jobs-schedular.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/app/auto-import-jobs-schedular/usecase/auto-import-jobs-schedular.ts b/apps/api/src/app/auto-import-jobs-schedular/usecase/auto-import-jobs-schedular.ts index 1e75ec1c..45916866 100644 --- a/apps/api/src/app/auto-import-jobs-schedular/usecase/auto-import-jobs-schedular.ts +++ b/apps/api/src/app/auto-import-jobs-schedular/usecase/auto-import-jobs-schedular.ts @@ -77,7 +77,7 @@ export class AutoImportJobsSchedular { }); if (!webhookDestination) { - return; + return false; } const { _id, callbackUrl } = webhookDestination;