disable rate limiter feature flag

This commit is contained in:
wphan
2024-01-08 11:19:07 -08:00
parent 8b3e19bdf2
commit 6731974870
2 changed files with 20 additions and 14 deletions

View File

@@ -116,6 +116,7 @@ app.use(compression());
app.set('trust proxy', 1); app.set('trust proxy', 1);
app.use(logHttp); app.use(logHttp);
app.use(handleResponseTime); app.use(handleResponseTime);
if (!FEATURE_FLAGS.DISABLE_RATE_LIMIT) {
app.use( app.use(
rateLimit({ rateLimit({
windowMs: 1000, // 1 second windowMs: 1000, // 1 second
@@ -131,6 +132,7 @@ app.use(
}, },
}) })
); );
}
// strip off /dlob, if the request comes from exchange history server LB // strip off /dlob, if the request comes from exchange history server LB
app.use((req, _res, next) => { app.use((req, _res, next) => {

View File

@@ -12,6 +12,10 @@ export const FEATURE_FLAGS = {
DISABLE_GPA_REFRESH: process.env.DISABLE_GPA_REFRESH DISABLE_GPA_REFRESH: process.env.DISABLE_GPA_REFRESH
? process.env.DISABLE_GPA_REFRESH.toLowerCase() === 'true' ? process.env.DISABLE_GPA_REFRESH.toLowerCase() === 'true'
: false, : false,
DISABLE_RATE_LIMIT: process.env.DISABLE_RATE_LIMIT
? process.env.DISABLE_RATE_LIMIT.toLowerCase() === 'true'
: false,
}; };
export default FEATURE_FLAGS; export default FEATURE_FLAGS;