From ea48761d6d9607957a10ac3d99cd5823c2520b3f Mon Sep 17 00:00:00 2001 From: titanism <101466223+titanism@users.noreply.github.com> Date: Wed, 6 Sep 2023 17:08:50 -0500 Subject: [PATCH] fix: added sorting to bounce report job --- jobs/bounce-report.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jobs/bounce-report.js b/jobs/bounce-report.js index b7119c0a22..0b97cfb192 100644 --- a/jobs/bounce-report.js +++ b/jobs/bounce-report.js @@ -97,7 +97,7 @@ function makeDelimitedString(arr) { }, bounce_category: { $ne: 'none' } }) - .sort({ bounce_category: 1 }) + .sort({ created_at: 1, bounce_category: 1 }) .cursor() .addCursorFlag('noCursorTimeout', true)) { if (typeof log?.err?.bounceInfo?.category !== 'string') continue; @@ -194,7 +194,7 @@ function makeDelimitedString(arr) { // super rudimentary and simple string concatenation const list = []; - for (const key of Object.keys(categories)) { + for (const key of Object.keys(categories).sort()) { list.push( `
  • ${titleize(humanize(key))}: ${ categories[key] @@ -213,6 +213,7 @@ function makeDelimitedString(arr) { ``, `

    Trusted hosts that were blocked:

    `, `` ].join('\n');