From 6bc312e3ba11d552cdb73c0054949751955e2668 Mon Sep 17 00:00:00 2001 From: Mohammad Ranjbar Z Date: Thu, 28 Sep 2023 09:47:56 +0330 Subject: [PATCH] Add more logs --- .../cronJobs/checkProjectVerificationStatus.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/services/cronJobs/checkProjectVerificationStatus.ts b/src/services/cronJobs/checkProjectVerificationStatus.ts index 132700b45..eb5f226c1 100644 --- a/src/services/cronJobs/checkProjectVerificationStatus.ts +++ b/src/services/cronJobs/checkProjectVerificationStatus.ts @@ -97,7 +97,16 @@ export const checkProjectVerificationStatus = async () => { }); for (const project of projects) { - await remindUpdatesOrRevokeVerification(project); + try { + await remindUpdatesOrRevokeVerification(project); + } catch (error) { + logger.error('Error in remindUpdatesOrRevokeVerification', { + projectId: project.id, + projectSlug: project.slug, + projectVerificationStatus: project.verificationStatus, + error, + }); + } } if (projects.length > 0) { @@ -110,7 +119,7 @@ export const checkProjectVerificationStatus = async () => { }; const remindUpdatesOrRevokeVerification = async (project: Project) => { - logger.debug('remindUpdatesOrRevokeVerification has been called', { + logger.debug('remindUpdatesOrRevokeVerification() has been called', { projectId: project.id, projectSlug: project.slug, projectVerificationStatus: project.verificationStatus, @@ -188,7 +197,7 @@ const remindUpdatesOrRevokeVerification = async (project: Project) => { const user = await User.findOne({ where: { id: Number(project.admin) } }); await sendProperNotification(project, project.verificationStatus as string); - await sleep(1000); + await sleep(300); }; const sendProperNotification = (