mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-06 13:08:14 +08:00
test: middleware/debug
This commit is contained in:
@@ -9,16 +9,11 @@ module.exports = async (ctx, next) => {
|
||||
ctx.debug.ips[ip] = 0;
|
||||
}
|
||||
ctx.debug.ips[ip]++;
|
||||
|
||||
if (ctx.request.path !== '/') {
|
||||
ctx.debug.request++;
|
||||
}
|
||||
ctx.debug.request++;
|
||||
|
||||
await next();
|
||||
|
||||
if (ctx.request.path !== '/') {
|
||||
if (ctx.response.get('X-Koa-Redis-Cache') || ctx.response.get('X-Koa-Memory-Cache')) {
|
||||
ctx.debug.hitCache++;
|
||||
}
|
||||
if (ctx.response.get('X-Koa-Redis-Cache') || ctx.response.get('X-Koa-Memory-Cache')) {
|
||||
ctx.debug.hitCache++;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user