aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-05-24 14:08:28 -0500
committermat <github@matdoes.dev>2021-05-24 14:08:28 -0500
commitb33fbf90a8c7df808ee88ac2b38782fcfe93f224 (patch)
tree447c4cef1ce5c4ef1ddb44f42b9e287c54d3f2f5 /build
parent17866766304a9049dda716a21d94bcd4803980a7 (diff)
downloadskyblock-api-b33fbf90a8c7df808ee88ac2b38782fcfe93f224.tar.gz
skyblock-api-b33fbf90a8c7df808ee88ac2b38782fcfe93f224.tar.bz2
skyblock-api-b33fbf90a8c7df808ee88ac2b38782fcfe93f224.zip
enable raw leaderboard cache again
Diffstat (limited to 'build')
-rw-r--r--build/database.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/build/database.js b/build/database.js
index 18a78f7..2d137cb 100644
--- a/build/database.js
+++ b/build/database.js
@@ -189,7 +189,6 @@ function isLeaderboardReversed(name) {
return false;
}
async function fetchMemberLeaderboardRaw(name) {
- return [];
if (!client)
throw Error('Client isn\'t initialized yet');
if (cachedRawLeaderboards.has(name))
@@ -208,7 +207,6 @@ async function fetchMemberLeaderboardRaw(name) {
return leaderboardRaw;
}
async function fetchProfileLeaderboardRaw(name) {
- return [];
if (cachedRawLeaderboards.has(name))
return cachedRawLeaderboards.get(name);
// typescript forces us to make a new variable and set it this way because it gives an error otherwise
@@ -227,12 +225,12 @@ async function fetchProfileLeaderboardRaw(name) {
/** Fetch a leaderboard that ranks members, as opposed to profiles */
async function fetchMemberLeaderboard(name) {
var _a;
+ const leaderboardRaw = await fetchMemberLeaderboardRaw(name);
return {
list: [],
name: 'Leaderboards are temporarily disabled, they\'ll be back in a few hours',
unit: ''
};
- const leaderboardRaw = await fetchMemberLeaderboardRaw(name);
const fetchLeaderboardPlayer = async (item) => {
return {
player: await cached.fetchBasicPlayer(item.uuid),
@@ -541,10 +539,10 @@ async function fetchAllLeaderboards(fast) {
if (!globalThis.isTest) {
connect().then(() => {
// when it connects, cache the leaderboards and remove bad members
- // removeBadMemberLeaderboardAttributes()
+ removeBadMemberLeaderboardAttributes();
// cache leaderboards on startup so its faster later on
- // fetchAllLeaderboards(true)
+ fetchAllLeaderboards(true);
// cache leaderboard players again every 4 hours
- // setInterval(fetchAllLeaderboards, 4 * 60 * 60 * 1000)
+ setInterval(fetchAllLeaderboards, 4 * 60 * 60 * 1000);
});
}