log slow redis chunk requests
This commit is contained in:
parent
1cc8c53242
commit
cacccbe23d
|
@ -42,7 +42,13 @@ export default async (req: Request, res: Response, next) => {
|
|||
// divided in height, which is not used yet
|
||||
// - this is not used and probably won't ever be used
|
||||
try {
|
||||
const stime = Date.now();
|
||||
chunk = await RedisCanvas.getChunk(c, x, y, z);
|
||||
const dur = Date.now() - stime;
|
||||
if (dur > 1000) {
|
||||
// eslint-disable-next-line max-len
|
||||
logger.warn(`Long redis response times of ${dur}ms for chunk ${c}:${x},${y},${z}`);
|
||||
}
|
||||
} catch {
|
||||
res.status(503).end();
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue
Block a user