From 870bd6e8988df0e5305c25b77fd1e9dc2dd2c05c Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Tue, 11 Jan 2022 18:47:42 +0000 Subject: [PATCH] Add local dev override for quotas --- packages/server/src/middleware/usageQuota.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/server/src/middleware/usageQuota.js b/packages/server/src/middleware/usageQuota.js index e487b555a0..3f8528d27f 100644 --- a/packages/server/src/middleware/usageQuota.js +++ b/packages/server/src/middleware/usageQuota.js @@ -8,6 +8,8 @@ const { } = require("../integrations/utils") const quotaMigration = require("../migrations/sync_app_and_reset_rows_quotas") +const testing = false + // tenants without limits const EXCLUDED_TENANTS = ["bb", "default", "bbtest", "bbstaging"] @@ -40,7 +42,10 @@ module.exports = async (ctx, next) => { const tenantId = getTenantId() // if in development or a self hosted cloud usage quotas should not be executed - if (env.isDev() || env.SELF_HOSTED || EXCLUDED_TENANTS.includes(tenantId)) { + if ( + (env.isDev() || env.SELF_HOSTED || EXCLUDED_TENANTS.includes(tenantId)) && + !testing + ) { return next() }