From 61c3966cbba07855bf544499bb3dac538e45d1b9 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 1 Nov 2021 20:23:51 +0530 Subject: [PATCH] refactor: increase csv batch download timeout Signed-off-by: Pranav C --- packages/noco-docs/content/en/getting-started/installation.md | 1 + packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSql.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/noco-docs/content/en/getting-started/installation.md b/packages/noco-docs/content/en/getting-started/installation.md index c18c25bcab..87f3a2a473 100644 --- a/packages/noco-docs/content/en/getting-started/installation.md +++ b/packages/noco-docs/content/en/getting-started/installation.md @@ -151,6 +151,7 @@ And connection params for this database can be specified in `NC_DB` environment | AWS_SECRET_ACCESS_KEY | No | For Litestream - S3 secret access key | If Litestream is configured and NC_DB is not present. SQLite gets backed up to S3 | | AWS_BUCKET | No | For Litestream - S3 bucket | If Litestream is configured and NC_DB is not present. SQLite gets backed up to S3 | | AWS_BUCKET_PATH | No | For Litestream - S3 bucket path (like folder within S3 bucket) | If Litestream is configured and NC_DB is not present. SQLite gets backed up to S3 | +| NC_EXPORT_MAX_TIMEOUT | No | After NC_EXPORT_MAX_TIMEOUT csv gets downloaded in batches | Default value 5000 will be used | ### Docker Compose diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSql.ts b/packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSql.ts index ede0e187df..246ea5980a 100644 --- a/packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSql.ts +++ b/packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSql.ts @@ -2428,7 +2428,7 @@ class BaseModelSql extends BaseModel { let offset = +args.offset || 0; const limit = 100; // const size = +process.env.NC_EXPORT_MAX_SIZE || 1024; - const timeout = +process.env.NC_EXPORT_MAX_TIMEOUT || 500; + const timeout = +process.env.NC_EXPORT_MAX_TIMEOUT || 5000; const csvRows = []; const startTime = process.hrtime(); let elapsed, temp;