aboutsummaryrefslogtreecommitdiff
path: root/src/database.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/database.ts')
-rw-r--r--src/database.ts20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/database.ts b/src/database.ts
index 5633ce4..a974f6c 100644
--- a/src/database.ts
+++ b/src/database.ts
@@ -424,12 +424,14 @@ async function fetchAllLeaderboards(fast?: boolean): Promise<void> {
if (debug) console.log('Finished caching leaderboards!')
}
-
-connect().then(() => {
- // when it connects, cache the leaderboards and remove bad members
- removeBadMemberLeaderboardAttributes()
- // cache leaderboards on startup so its faster later on
- fetchAllLeaderboards(true)
- // cache leaderboard players again every 4 hours
- setInterval(fetchAllLeaderboards, 4 * 60 * 60 * 1000)
-})
+// make sure it's not in a test
+if (typeof global.it !== 'function') {
+ connect().then(() => {
+ // when it connects, cache the leaderboards and remove bad members
+ removeBadMemberLeaderboardAttributes()
+ // cache leaderboards on startup so its faster later on
+ fetchAllLeaderboards(true)
+ // cache leaderboard players again every 4 hours
+ setInterval(fetchAllLeaderboards, 4 * 60 * 60 * 1000)
+ })
+} \ No newline at end of file