Skip to content

Commit 6808667

Browse files
committed
fix duplicate config loading
1 parent dde1a23 commit 6808667

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/middlewares.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export async function handleParseHeaders(req, res, next) {
224224
}
225225

226226
const clientIp = getClientIp(req);
227-
const config = Config.get(info.appId, mount);
227+
const config = req.config || Config.get(info.appId, mount);
228228
if (config.state && config.state !== 'ok') {
229229
res.status(500);
230230
res.json({
@@ -233,7 +233,9 @@ export async function handleParseHeaders(req, res, next) {
233233
});
234234
return;
235235
}
236-
await config.loadKeys();
236+
if (!req.config) {
237+
await config.loadKeys();
238+
}
237239

238240
info.app = AppCache.get(info.appId);
239241
req.config = config;

0 commit comments

Comments
 (0)