mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-06 06:37:35 +08:00
chore: only log daily changes 6 hours after the reset
This commit is contained in:
parent
2a9507ab1e
commit
255fd7f410
1 changed files with 6 additions and 1 deletions
|
@ -541,7 +541,12 @@ export async function addResult(
|
|||
dailyLeaderboardRank <= 10 &&
|
||||
completedEvent.testDuration <= 120
|
||||
) {
|
||||
await addLog("daily_leaderboard_top_10_result", completedEvent, uid);
|
||||
const now = Date.now();
|
||||
const reset = getCurrentDayTimestamp();
|
||||
const limit = 6 * 60 * 60 * 1000;
|
||||
if (now - reset >= limit) {
|
||||
await addLog("daily_leaderboard_top_10_result", completedEvent, uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue