Skip to content

Commit c277739

Browse files
authored
fix: Rate limiting can fail when using Parse Server option rateLimit.redisUrl with clusters (#8632)
1 parent cfcb943 commit c277739

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/middlewares.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -531,19 +531,17 @@ export const addRateLimit = (route, config, cloud) => {
531531
const redisStore = {
532532
connectionPromise: Promise.resolve(),
533533
store: null,
534-
connected: false,
535534
};
536535
if (route.redisUrl) {
537536
const client = createClient({
538537
url: route.redisUrl,
539538
});
540539
redisStore.connectionPromise = async () => {
541-
if (redisStore.connected) {
540+
if (client.isOpen) {
542541
return;
543542
}
544543
try {
545544
await client.connect();
546-
redisStore.connected = true;
547545
} catch (e) {
548546
const log = config?.loggerController || defaultLogger;
549547
log.error(`Could not connect to redisURL in rate limit: ${e}`);

0 commit comments

Comments
 (0)