fix: error in errorHandler
This commit is contained in:
@@ -15,8 +15,12 @@ export const errorHandler: ErrorHandler = (error, ctx) => {
|
||||
const hasMatchedRoute = matchedRoute !== '/*';
|
||||
|
||||
const debug = getDebugInfo();
|
||||
if (ctx.res.headers.get('RSSHub-Cache-Status')) {
|
||||
debug.hitCache++;
|
||||
try {
|
||||
if (ctx.res.headers.get('RSSHub-Cache-Status')) {
|
||||
debug.hitCache++;
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
debug.error++;
|
||||
|
||||
|
||||
@@ -39,9 +39,7 @@ const loginLimiter = cache.clients.redisClient
|
||||
execEvenly: true,
|
||||
});
|
||||
|
||||
const loginLimiterQueue = new RateLimiterQueue(loginLimiter, {
|
||||
maxQueueSize: 100,
|
||||
});
|
||||
const loginLimiterQueue = new RateLimiterQueue(loginLimiter);
|
||||
|
||||
async function login({ username, password, authenticationSecret }) {
|
||||
return (await cache.tryGet(
|
||||
|
||||
@@ -26,9 +26,7 @@ const loginLimiter = cache.clients.redisClient
|
||||
execEvenly: true,
|
||||
});
|
||||
|
||||
const loginLimiterQueue = new RateLimiterQueue(loginLimiter, {
|
||||
maxQueueSize: 200,
|
||||
});
|
||||
const loginLimiterQueue = new RateLimiterQueue(loginLimiter);
|
||||
|
||||
const token2Cookie = (token) =>
|
||||
cache.tryGet(`twitter:cookie:${token}`, async () => {
|
||||
|
||||
Reference in New Issue
Block a user