Skip to content

Commit

Permalink
Add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadranjbarz committed Sep 28, 2023
1 parent a8e3bb2 commit 6bc312e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/services/cronJobs/checkProjectVerificationStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down Expand Up @@ -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 = (
Expand Down

0 comments on commit 6bc312e

Please sign in to comment.