Adding check to disable rate limit redis connection in test.
This commit is contained in:
parent
2247987df2
commit
a1b95c15e5
|
@ -22,6 +22,7 @@ const { getRedisOptions } = require("@budibase/backend-core/redis").utils
|
|||
const PREFIX = "/api/public/v1"
|
||||
const DEFAULT_API_LIMITING = 120
|
||||
|
||||
if (!env.isTest()) {
|
||||
const REDIS_OPTS = getRedisOptions()
|
||||
RateLimit.defaultOptions({
|
||||
store: new Stores.Redis({
|
||||
|
@ -33,6 +34,7 @@ RateLimit.defaultOptions({
|
|||
database: 1,
|
||||
}),
|
||||
})
|
||||
}
|
||||
// rate limiting, allows for 2 requests per second
|
||||
const limiter = RateLimit.middleware({
|
||||
interval: { min: 1 },
|
||||
|
|
Loading…
Reference in New Issue