Add keyPrefix to redis

pull/2723/head
Jérémy Rialland 2023-06-15 16:29:29 +02:00 committed by Jérémy Rialland
parent 9a8cf26317
commit 23bebf94d4
2 changed files with 3 additions and 1 deletions

View File

@ -13,8 +13,9 @@ const rateLimiter =
? new RateLimiterRedis({
storeClient: new Redis(process.env.SCALINGO_REDIS_URL, {
enableOfflineQueue: false,
keyPrefix: 'rate-limiter',
}),
keyPrefix: 'middleware',
keyPrefix: 'rate-limiter',
points: 5, // 5 requests for ctx.ip
duration: 1, // per 1 second
})

View File

@ -13,6 +13,7 @@ const redis =
process.env.NODE_ENV === 'production' && process.env.SCALINGO_REDIS_URL
? new Redis(process.env.SCALINGO_REDIS_URL, {
enableOfflineQueue: false,
keyPrefix: 'cache',
})
: new RedisMock()