diff --git a/src/core/Ranks.js b/src/core/Ranks.js index d7033f6..cacf170 100644 --- a/src/core/Ranks.js +++ b/src/core/Ranks.js @@ -15,7 +15,6 @@ import { storeHourlyPixelsPlaced, getHourlyPixelStats, getDailyPixelStats, - populateDailyTotal, } from '../data/redis/ranks'; import socketEvents from '../socket/socketEvents'; import logger from './logger'; @@ -39,7 +38,7 @@ class Ranks { // ranking of countries by day cHistStats: [], // ranking of users by day - histStats: [], + histStats: { users: [], stats: [] }, // pixels placed by hour pHourlyStats: [], // pixels placed by day @@ -57,7 +56,6 @@ class Ranks { } async initialize() { - await populateDailyTotal(); try { let someRanks = await Ranks.dailyUpdateRanking(); this.ranks = { diff --git a/src/data/redis/ranks.js b/src/data/redis/ranks.js index 1ddc1c8..03e55dd 100644 --- a/src/data/redis/ranks.js +++ b/src/data/redis/ranks.js @@ -227,20 +227,6 @@ export async function getTopDailyHistory() { }; } -/* - * for populating past daily totals - */ -export async function populateDailyTotal() { - await client.del(DAILY_PXL_CNTR_KEY); - for (let i = 14; i > 0; i -= 1) { - const ts = Date.now() - 1000 * 3600 * 24 * i; - const key = `${CDAY_STATS_RANKS_KEY}:${getDateKeyOfTs(ts)}`; - // eslint-disable-next-line no-await-in-loop - const sum = await sumZSet(key); - client.lPush(DAILY_PXL_CNTR_KEY, String(sum)); - } -} - /* * get top 10 countries over the past days */ diff --git a/src/store/sharedReducers.js b/src/store/sharedReducers.js index dfd5057..92a0aa7 100644 --- a/src/store/sharedReducers.js +++ b/src/store/sharedReducers.js @@ -15,7 +15,7 @@ import canvas from './reducers/canvas'; import chat from './reducers/chat'; import fetching from './reducers/fetching'; -export const CURRENT_VERSION = 14; +export const CURRENT_VERSION = 15; export const migrate = (state, version) => { // eslint-disable-next-line no-underscore-dangle