diff --git a/src/core/ranking.js b/src/core/ranking.js index b136eaf..4da82b0 100644 --- a/src/core/ranking.js +++ b/src/core/ranking.js @@ -18,7 +18,6 @@ class Ranks { this.resetDailyRanking = this.resetDailyRanking.bind(this); this.ranks = {}; - this.updateRanking(); setInterval(this.updateRanking, 5 * MINUTE); DailyCron.hook(this.resetDailyRanking); } diff --git a/src/web.js b/src/web.js index b0354db..b5142a7 100644 --- a/src/web.js +++ b/src/web.js @@ -11,6 +11,7 @@ import etag from 'etag'; import forceGC from './core/forceGC'; import assets from './assets.json'; // eslint-disable-line import/no-unresolved import logger from './core/logger'; +import rankings from './core/ranking'; import models from './data/models'; import { @@ -166,6 +167,7 @@ app.get('/', async (req, res) => { const promise = models.sync().catch((err) => logger.error(err.stack)); promise.then(() => { server.listen(PORT, () => { + rankings.updateRanking(); const address = server.address(); logger.log('info', `web is running at http://localhost:${address.port}/`); });