From 7d87d0c3e058e1f6a8c129b2808a5e6ade3b47d6 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 10 Feb 2022 19:30:36 -0600 Subject: fix leaderboards not loading sometimes, hopefully --- src/hypixelCached.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/hypixelCached.ts') diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts index d5b6628..b49a190 100644 --- a/src/hypixelCached.ts +++ b/src/hypixelCached.ts @@ -3,8 +3,8 @@ */ import { CleanProfile, CleanFullProfile, CleanBasicProfile } from './cleaners/skyblock/profile.js' +import { isUuid, sleep, undashUuid } from './util.js' import { CleanPlayer } from './cleaners/player.js' -import { isUuid, undashUuid } from './util.js' import * as hypixel from './hypixel.js' import * as mojang from './mojang.js' import NodeCache from 'node-cache' @@ -166,7 +166,7 @@ export async function fetchPlayer(user: string): Promise { // if it's already in the process of fetching, check every 100ms until it's not fetching the player anymore and fetch it again, since it'll be cached now if (fetchingPlayers.has(playerUuid)) { while (fetchingPlayers.has(playerUuid)) { - await new Promise(resolve => setTimeout(resolve, 100)) + await sleep(100) } return await fetchPlayer(user) } -- cgit