mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-25 00:48:22 +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);
|
||||
}
|
||||
|
||||
if (db.highLoad()) {
|
||||
return res.status(503).send("Disabled for load reasons");
|
||||
}
|
||||
|
||||
//setup which sort type to use
|
||||
let sortBy = "";
|
||||
if (sortType == 0) {
|
||||
|
||||
@@ -88,6 +88,10 @@ export async function getTopUsers(req: Request, res: Response): Promise<Response
|
||||
return res.sendStatus(400);
|
||||
}
|
||||
|
||||
if (db.highLoad()) {
|
||||
return res.status(503).send("Disabled for load reasons");
|
||||
}
|
||||
|
||||
const stats = await getTopUsersWithCache(sortBy, categoryStatsEnabled);
|
||||
|
||||
//send this result
|
||||
|
||||
Reference in New Issue
Block a user