From 1e6fda57a99fa7102d21401ab8858ed4b7eebc76 Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 18 Apr 2024 20:26:39 +0200 Subject: [PATCH] fix(CSV Upload): Ignores CSV file as part of the API Event data column --- .../geo-features/import/features-amounts-upload.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/apps/api/src/modules/geo-features/import/features-amounts-upload.service.ts b/api/apps/api/src/modules/geo-features/import/features-amounts-upload.service.ts index acc120f5dc..40aa65eaf6 100644 --- a/api/apps/api/src/modules/geo-features/import/features-amounts-upload.service.ts +++ b/api/apps/api/src/modules/geo-features/import/features-amounts-upload.service.ts @@ -72,7 +72,10 @@ export class FeatureAmountUploadService { projectId: string; userId: string; }): Promise | Right> { - await this.events.submittedEvent(data.projectId, data); + //Because feature CSV files are bound to be increasingly larger, this can cause problems when trying to save a big + //JSONB value into postgres eventually crashing due to an memory error, so the CSV file is ignored for the api event + const { fileBuffer, ...apiEventData } = data; + await this.events.submittedEvent(data.projectId, apiEventData); const apiQueryRunner = this.apiDataSource.createQueryRunner(); const geoQueryRunner = this.geoDataSource.createQueryRunner();