Skip to content

Commit

Permalink
YourTurn: Tweak some logging to track down a delivery issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Perlkonig committed Sep 21, 2024
1 parent c2850f8 commit d2270c9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions utils/yourturn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const handler: Handler = async (event: any, context?: any) => {
}
}
}
console.log(JSON.stringify(p2g, null, 2));
console.log(JSON.stringify([...p2g.entries()], null, 2));

// Get list of users
const notifications: [PartialUser, number][] = [];
Expand Down Expand Up @@ -165,7 +165,13 @@ export const handler: Handler = async (event: any, context?: any) => {
const work: Promise<any>[] = [];

// Sort by language to minimize locale changes
notifications.sort((a, b) => a[0].language.localeCompare(b[0].language));
notifications.sort((a, b) => {
if (a[0].language === b[0].language) {
return a[0].name.localeCompare(b[0].name);
} else {
return a[0].language.localeCompare(b[0].language)
}
});
let lastlang: string|undefined = undefined;
for (const [p, n] of notifications) {
if (p.language !== lastlang) {
Expand Down

0 comments on commit d2270c9

Please sign in to comment.