mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix: cache next error not catch (#8361)
This commit is contained in:
Vendored
+7
-1
@@ -114,7 +114,13 @@ module.exports = function (app) {
|
||||
|
||||
// Doesn't hit the cache? We need to let others know!
|
||||
await globalCache.set(controlKey, '1', config.cache.requestTimeout);
|
||||
await next();
|
||||
|
||||
try {
|
||||
await next();
|
||||
} catch (e) {
|
||||
await globalCache.set(controlKey, '0', config.cache.requestTimeout);
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (ctx.response.get('Cache-Control') !== 'no-cache' && ctx.state && ctx.state.data) {
|
||||
ctx.state.data.lastBuildDate = new Date().toUTCString();
|
||||
|
||||
Reference in New Issue
Block a user