mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01:00
Log redis stats on high db load
This commit is contained in:
parent
7678be1e24
commit
6edd71194b
1 changed files with 2 additions and 0 deletions
|
@ -16,6 +16,7 @@ import { parseSkipSegments } from "../utils/parseSkipSegments";
|
|||
import { getEtag } from "../middleware/etag";
|
||||
import { shuffleArray } from "../utils/array";
|
||||
import { Postgres } from "../databases/Postgres";
|
||||
import { getRedisStats } from "../utils/redis";
|
||||
|
||||
async function prepareCategorySegments(req: Request, videoID: VideoID, service: Service, segments: DBSegment[], cache: SegmentCache = { shadowHiddenSegmentIPs: {} }, useCache: boolean): Promise<Segment[]> {
|
||||
const shouldFilter: boolean[] = await Promise.all(segments.map(async (segment) => {
|
||||
|
@ -49,6 +50,7 @@ async function prepareCategorySegments(req: Request, videoID: VideoID, service:
|
|||
Logger.error(`Postgres stats: ${JSON.stringify(db.getStats())}`);
|
||||
Logger.error(`Postgres private stats: ${JSON.stringify(privateDB.getStats())}`);
|
||||
}
|
||||
Logger.error(`Redis stats: ${JSON.stringify(getRedisStats())}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue