mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-26 17:38:28 +03:00
Add high load checks to leaderboard pages
This commit is contained in:
@@ -56,6 +56,10 @@ export async function getTopCategoryUsers(req: Request, res: Response): Promise<
|
|||||||
return res.sendStatus(400);
|
return res.sendStatus(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (db.highLoad()) {
|
||||||
|
return res.status(503).send("Disabled for load reasons");
|
||||||
|
}
|
||||||
|
|
||||||
//setup which sort type to use
|
//setup which sort type to use
|
||||||
let sortBy = "";
|
let sortBy = "";
|
||||||
if (sortType == 0) {
|
if (sortType == 0) {
|
||||||
|
|||||||
@@ -88,6 +88,10 @@ export async function getTopUsers(req: Request, res: Response): Promise<Response
|
|||||||
return res.sendStatus(400);
|
return res.sendStatus(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (db.highLoad()) {
|
||||||
|
return res.status(503).send("Disabled for load reasons");
|
||||||
|
}
|
||||||
|
|
||||||
const stats = await getTopUsersWithCache(sortBy, categoryStatsEnabled);
|
const stats = await getTopUsersWithCache(sortBy, categoryStatsEnabled);
|
||||||
|
|
||||||
//send this result
|
//send this result
|
||||||
|
|||||||
Reference in New Issue
Block a user