mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-27 18:08:23 +03:00
Allow disabling redis rate limit
This commit is contained in:
@@ -32,7 +32,8 @@ export function rateLimitMiddleware(limitConfig: RateLimitConfig, getUserID?: (r
|
||||
}
|
||||
},
|
||||
store: config.redis?.enabled ? new RedisStore({
|
||||
sendCommand: (...args: string[]) => redis.sendCommand(args).catch((err) => Logger.error(err)) as Promise<RedisReply>,
|
||||
sendCommand: (...args: string[]) => config.redisRateLimit ? redis.sendCommand(args).catch((err) => Logger.error(err)) as Promise<RedisReply>
|
||||
: Promise.resolve(null) as Promise<RedisReply>,
|
||||
}) : null,
|
||||
});
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user