Skip to content

Commit

Permalink
Fix calling remind project update notification and more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadranjbarz committed Sep 28, 2023
1 parent 3994472 commit a8e3bb2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/services/cronJobs/checkProjectVerificationStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand 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) &&
Expand Down

0 comments on commit a8e3bb2

Please sign in to comment.