diff options
author | mat <github@matdoes.dev> | 2022-02-13 21:34:00 -0600 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-02-13 21:34:00 -0600 |
commit | 2a6c5997c453e8ffa382db2e0ad5cb5db4f73db1 (patch) | |
tree | 3362993151dd7db2e2b5776ea83d1723999ab9bb /src | |
parent | f20cdf862a6c52b0088279656592bd710a0051c3 (diff) | |
download | skyblock-api-2a6c5997c453e8ffa382db2e0ad5cb5db4f73db1.tar.gz skyblock-api-2a6c5997c453e8ffa382db2e0ad5cb5db4f73db1.tar.bz2 skyblock-api-2a6c5997c453e8ffa382db2e0ad5cb5db4f73db1.zip |
maybe fix some leaderboards hanging
Diffstat (limited to 'src')
-rw-r--r-- | src/database.ts | 2 | ||||
-rw-r--r-- | src/hypixelCached.ts | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/database.ts b/src/database.ts index e195eed..6b57bc0 100644 --- a/src/database.ts +++ b/src/database.ts @@ -297,7 +297,7 @@ async function fetchMemberLeaderboardRaw(name: string): Promise<memberRawLeaderb return cachedRawLeaderboards.get(name) as memberRawLeaderboardItem[] // if it's currently being fetched, check every 100ms until it's in cachedRawLeaderboards - if (fetchingRawLeaderboardNames.has(name)) { + if (fetchingRawLeaderboardNames.has(name) || !cachedRawLeaderboards.get(name)) { while (true) { await sleep(100) if (cachedRawLeaderboards.has(name)) diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts index b49a190..3130f41 100644 --- a/src/hypixelCached.ts +++ b/src/hypixelCached.ts @@ -263,7 +263,7 @@ async function fetchBasicProfiles(user: string): Promise<CleanBasicProfile[] | n const player = await fetchPlayer(playerUuid) if (!player) { - console.log('bruh playerUuid', user, playerUuid) + // this happens when the player changed their name recently and the old name is cached on hypixel return [] } const profiles = player.profiles |