Skip to content

Commit

Permalink
fix: return early if count was zero for bounce reports
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Oct 2, 2023
1 parent de5b487 commit 84c12f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/web/my-account/list-logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ async function listLogs(ctx) {
const now = new Date();
getLogsCsv(now, query)
.then((results) => {
// if no results return early
if (results.count === 0) return;
// email the spreadsheet to admins
emailHelper({
template: 'alert',
Expand Down
2 changes: 2 additions & 0 deletions jobs/bounce-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ graceful.listen();
}
});

if (count === 0) throw new Error('No deliverability logs');

// email the spreadsheet to admins
await emailHelper({
template: 'alert',
Expand Down

0 comments on commit 84c12f4

Please sign in to comment.