aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-06-01 16:54:25 -0500
committermat <github@matdoes.dev>2021-06-01 16:54:25 -0500
commitac1a21f5ec551b8cfe7a58611301b7f2742269d0 (patch)
tree46c8a6fc8a2676274d1b0d2a58ca4dd5324ff213 /src/index.ts
parent04d79fe41fae83eed8f17eda97e4e4827dc79e92 (diff)
downloadskyblock-api-ac1a21f5ec551b8cfe7a58611301b7f2742269d0.tar.gz
skyblock-api-ac1a21f5ec551b8cfe7a58611301b7f2742269d0.tar.bz2
skyblock-api-ac1a21f5ec551b8cfe7a58611301b7f2742269d0.zip
add queue sizes to index debug data
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/index.ts b/src/index.ts
index d6859d4..a4f9a39 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,4 +1,4 @@
-import { createSession, fetchAccountFromDiscord, fetchAllLeaderboardsCategorized, fetchLeaderboard, fetchMemberLeaderboardSpots, fetchSession, finishedCachingRawLeaderboards, updateAccount } from './database'
+import { createSession, fetchAccountFromDiscord, fetchAllLeaderboardsCategorized, fetchLeaderboard, fetchMemberLeaderboardSpots, fetchSession, finishedCachingRawLeaderboards, leaderboardUpdateMemberQueue, leaderboardUpdateProfileQueue, updateAccount } from './database'
import { fetchMemberProfile, fetchUser } from './hypixel'
import rateLimit from 'express-rate-limit'
import * as constants from './constants'
@@ -36,7 +36,9 @@ app.get('/', async(req, res) => {
res.json({
ok: true,
uptimeHours: (currentTime - startTime) / 1000 / 60 / 60,
- finishedCachingRawLeaderboards
+ finishedCachingRawLeaderboards,
+ leaderboardUpdateMemberQueueSize: leaderboardUpdateMemberQueue.size,
+ leaderboardUpdateProfileQueueSize: leaderboardUpdateProfileQueue.size,
})
})
@@ -79,10 +81,9 @@ app.get('/player/:user/:profile', async(req, res) => {
app.get('/player/:user/:profile/leaderboards', async(req, res) => {
try {
- res.json({ ok: false })
- // res.json(
- // await fetchMemberLeaderboardSpots(req.params.user, req.params.profile)
- // )
+ res.json(
+ await fetchMemberLeaderboardSpots(req.params.user, req.params.profile)
+ )
} catch (err) {
console.error(err)
res.json({ ok: false })