Skip to content

Commit

Permalink
fix: lbac 2187: pas de logs lorsqu'il n'y a pas de candidature (#1392)
Browse files Browse the repository at this point in the history
  • Loading branch information
remy-auricoste authored Jul 30, 2024
1 parent 9d29426 commit 507c823
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions server/src/jobs/applications/processApplications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ export async function processApplications(batchSize: number) {
scanResult.success += normalScanResult.success + errorScanResult.success
scanResult.error += normalScanResult.error + errorScanResult.error
scanResult.total += normalScanResult.total + errorScanResult.total
await notifyToSlack({
subject: "Scan des candidatures",
message: `${scanResult.total} candidatures à scanner. ${scanResult.success} candidatures scannées. ${scanResult.error} erreurs.`,
error: scanResult.error > 0,
})
if (scanResult.total > 0) {
await notifyToSlack({
subject: "Scan des candidatures",
message: `${scanResult.total} candidatures à scanner. ${scanResult.success} candidatures scannées. ${scanResult.error} erreurs.`,
error: scanResult.error > 0,
})
}
} else {
await notifyToSlack({
subject: "Scan des candidatures",
Expand All @@ -32,11 +34,13 @@ export async function processApplications(batchSize: number) {
})
}
const emailResult = await sendApplicationsEmails({ to_applicant_message_id: null, scan_status: ApplicationScanStatus.NO_VIRUS_DETECTED }, batchSize)
await notifyToSlack({
subject: "Envoi des candidatures",
message: `${emailResult.total} candidatures à envoyer. ${emailResult.success} candidatures envoyées. ${emailResult.error} erreurs.`,
error: emailResult.error > 0,
})
if (emailResult.total > 0) {
await notifyToSlack({
subject: "Envoi des candidatures",
message: `${emailResult.total} candidatures à envoyer. ${emailResult.success} candidatures envoyées. ${emailResult.error} erreurs.`,
error: emailResult.error > 0,
})
}
logger.info("ended job processApplications")
}

Expand Down

0 comments on commit 507c823

Please sign in to comment.