mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
updating leaderboards every 15 minutes
This commit is contained in:
parent
d80ad81746
commit
6459983840
2 changed files with 2 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ import BotDAO from "../dao/bot";
|
|||
import { Document, WithId } from "mongodb";
|
||||
import LeaderboardsDAO from "../dao/leaderboards";
|
||||
|
||||
const CRON_SCHEDULE = "30 4/5 * * * *";
|
||||
const CRON_SCHEDULE = "30 14/15 * * * *";
|
||||
const RECENT_AGE_MINUTES = 10;
|
||||
const RECENT_AGE_MILLISECONDS = RECENT_AGE_MINUTES * 60 * 1000;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ function stopTimer(): void {
|
|||
|
||||
function updateTimerElement(): void {
|
||||
const date = new Date();
|
||||
const minutesToNextUpdate = 4 - (date.getMinutes() % 5);
|
||||
const minutesToNextUpdate = 14 - (date.getMinutes() % 15);
|
||||
const secondsToNextUpdate = 60 - date.getSeconds();
|
||||
const totalSeconds = minutesToNextUpdate * 60 + secondsToNextUpdate;
|
||||
$("#leaderboards .subTitle").text(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue