mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
fix: daily leaderboard worker not giving XP to users (@fehmer) (#6292)
This commit is contained in:
parent
8bc23b7c3d
commit
598e167f9b
1 changed files with 9 additions and 3 deletions
|
|
@ -28,11 +28,19 @@ async function handleDailyLeaderboardResults(
|
|||
users: { inbox: inboxConfig },
|
||||
} = await getCachedConfiguration(false);
|
||||
|
||||
const { maxResults, xpRewardBrackets, topResultsToAnnounce } =
|
||||
dailyLeaderboardsConfig;
|
||||
|
||||
const maxRankToGet = Math.max(
|
||||
topResultsToAnnounce,
|
||||
...xpRewardBrackets.map((bracket) => bracket.maxRank)
|
||||
);
|
||||
|
||||
const dailyLeaderboard = new DailyLeaderboard(modeRule, yesterdayTimestamp);
|
||||
|
||||
const results = await dailyLeaderboard.getResults(
|
||||
0,
|
||||
-1,
|
||||
maxRankToGet,
|
||||
dailyLeaderboardsConfig,
|
||||
false
|
||||
);
|
||||
|
|
@ -41,8 +49,6 @@ async function handleDailyLeaderboardResults(
|
|||
return;
|
||||
}
|
||||
|
||||
const { maxResults, xpRewardBrackets } = dailyLeaderboardsConfig;
|
||||
|
||||
if (inboxConfig.enabled && xpRewardBrackets.length > 0) {
|
||||
const mailEntries: {
|
||||
uid: string;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue