From c4ef8c364d942ef9a56b7b8547e9cd4364902576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=A1=C9=A8=D5=BC=C9=A2=D3=84=D5=A1=D6=85=D5=BC=C9=A2?= Date: Tue, 24 Oct 2023 19:45:25 +0800 Subject: [PATCH] fix(nocodb): config limit --- packages/nocodb/src/db/BaseModelSql.ts | 6 +++--- packages/nocodb/src/services/utils.service.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nocodb/src/db/BaseModelSql.ts b/packages/nocodb/src/db/BaseModelSql.ts index 8f93688836..b8f8d9c808 100644 --- a/packages/nocodb/src/db/BaseModelSql.ts +++ b/packages/nocodb/src/db/BaseModelSql.ts @@ -74,9 +74,9 @@ class BaseModelSql extends BaseModel { this.manyToManyRelations = manyToMany; this.virtualColumns = v; this.config = { - limitDefault: process.env.DB_QUERY_LIMIT_DEFAULT || 25, - limitMax: process.env.DB_QUERY_LIMIT_MAX || 100, - limitMin: process.env.DB_QUERY_LIMIT_MIN || 1, + limitDefault: Math.max(+process.env.DB_QUERY_LIMIT_DEFAULT || 25, 1), + limitMin: Math.max(+process.env.DB_QUERY_LIMIT_MIN || 1, 1), + limitMax: Math.max(+process.env.DB_QUERY_LIMIT_MAX || 1000, 1), log: false, explain: false, hasManyMax: 5, diff --git a/packages/nocodb/src/services/utils.service.ts b/packages/nocodb/src/services/utils.service.ts index 000ee4f137..6e95c2006b 100644 --- a/packages/nocodb/src/services/utils.service.ts +++ b/packages/nocodb/src/services/utils.service.ts @@ -393,7 +393,7 @@ export class UtilsService { defaultLimit: Math.max( Math.min( +process.env.DB_QUERY_LIMIT_DEFAULT || 25, - +process.env.DB_QUERY_LIMIT_MAX || 100, + +process.env.DB_QUERY_LIMIT_MAX || 1000, ), +process.env.DB_QUERY_LIMIT_MIN || 1, ),