fix the global allContext issue

This commit is contained in:
Sha Zhou
2025-05-13 16:05:08 +08:00
parent 2e8079b613
commit f62bb348d4
2 changed files with 7 additions and 10 deletions

View File

@@ -192,6 +192,8 @@ export const jinaAiMiddleware = (req: Request, res: Response, next: NextFunction
}
).catch((err: any) => {
logger.warn(`Failed to save promptContext`, { err: marshalErrorLike(err) });
}).finally(() => {
ctx.promptContext = undefined;
});
}
@@ -211,10 +213,6 @@ export const jinaAiMiddleware = (req: Request, res: Response, next: NextFunction
if (err.stack) {
logger.error(err.stack);
}
} finally {
if (ctx.promptContext) {
ctx.promptContext = null;
}
}
});