From 5d6682ccc27b752902912cfe18a665662290d7fb Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 31 May 2021 00:01:06 -0500 Subject: removed fetching all the members in all of the leaderboards --- build/database.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'build/database.js') diff --git a/build/database.js b/build/database.js index 4ba2376..34727f9 100644 --- a/build/database.js +++ b/build/database.js @@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.updateAccount = exports.fetchAccountFromDiscord = exports.fetchAccount = exports.fetchSession = exports.createSession = exports.finishedCachingAllLeaderboards = exports.finishedCachingRawLeaderboards = exports.queueUpdateDatabaseProfile = exports.queueUpdateDatabaseMember = exports.updateDatabaseProfile = exports.updateDatabaseMember = exports.fetchMemberLeaderboardSpots = exports.fetchLeaderboard = exports.fetchProfileLeaderboard = exports.fetchMemberLeaderboard = exports.fetchAllMemberLeaderboardAttributes = exports.fetchSlayerLeaderboards = exports.fetchAllLeaderboardsCategorized = exports.cachedRawLeaderboards = void 0; +exports.updateAccount = exports.fetchAccountFromDiscord = exports.fetchAccount = exports.fetchSession = exports.createSession = exports.finishedCachingRawLeaderboards = exports.queueUpdateDatabaseProfile = exports.queueUpdateDatabaseMember = exports.updateDatabaseProfile = exports.updateDatabaseMember = exports.fetchMemberLeaderboardSpots = exports.fetchLeaderboard = exports.fetchProfileLeaderboard = exports.fetchMemberLeaderboard = exports.fetchAllMemberLeaderboardAttributes = exports.fetchSlayerLeaderboards = exports.fetchAllLeaderboardsCategorized = exports.cachedRawLeaderboards = void 0; const stats_1 = require("./cleaners/skyblock/stats"); const slayers_1 = require("./cleaners/skyblock/slayers"); const mongodb_1 = require("mongodb"); @@ -538,7 +538,6 @@ async function removeBadMemberLeaderboardAttributes() { } } exports.finishedCachingRawLeaderboards = false; -exports.finishedCachingAllLeaderboards = false; /** Fetch all the leaderboards, used for caching. Don't call this often! */ async function fetchAllLeaderboards(fast) { const leaderboards = await fetchAllMemberLeaderboardAttributes(); @@ -547,20 +546,6 @@ async function fetchAllLeaderboards(fast) { for (const leaderboard of util_1.shuffle(leaderboards)) await fetchMemberLeaderboardRaw(leaderboard); exports.finishedCachingRawLeaderboards = true; - // shuffle so if the application is restarting many times itll still be useful - if (_1.debug) - console.debug('Caching leaderboards!'); - for (const leaderboard of util_1.shuffle(leaderboards)) { - if (!fast) - // wait 2 seconds so it doesnt use as much ram - await util_1.sleep(2 * 1000); - else - await util_1.sleep(500); - await fetchMemberLeaderboard(leaderboard); - } - exports.finishedCachingAllLeaderboards = true; - if (_1.debug) - console.debug('Finished caching leaderboards!'); } async function createSession(refreshToken, userData) { const sessionId = uuid_1.v4(); -- cgit