From a8e3bb2e24bb01e4f73ca34bb3383c6e08ab900f Mon Sep 17 00:00:00 2001 From: Mohammad Ranjbar Z Date: Thu, 28 Sep 2023 09:16:01 +0330 Subject: [PATCH] Fix calling remind project update notification and more logs --- .../cronJobs/checkProjectVerificationStatus.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/services/cronJobs/checkProjectVerificationStatus.ts b/src/services/cronJobs/checkProjectVerificationStatus.ts index df386c956..132700b45 100644 --- a/src/services/cronJobs/checkProjectVerificationStatus.ts +++ b/src/services/cronJobs/checkProjectVerificationStatus.ts @@ -96,8 +96,9 @@ export const checkProjectVerificationStatus = async () => { foundProjectsCount: projects?.length, }); - // Run all iterations async, resulting in array of promises - await Promise.all(projects.map(remindUpdatesOrRevokeVerification)); + for (const project of projects) { + await remindUpdatesOrRevokeVerification(project); + } if (projects.length > 0) { await Promise.all([ @@ -109,6 +110,11 @@ export const checkProjectVerificationStatus = async () => { }; const remindUpdatesOrRevokeVerification = async (project: Project) => { + logger.debug('remindUpdatesOrRevokeVerification has been called', { + projectId: project.id, + projectSlug: project.slug, + projectVerificationStatus: project.verificationStatus, + }); // Projects up for revoking when 30 days are done after feature release if ( new Date() >= new Date(projectUpdatesFirstRevokeBatchDate) &&