Add keyPrefix to redis
parent
9a8cf26317
commit
23bebf94d4
|
@ -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
|
||||
})
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue