From c7e9a4375f4747908f70891c03ace97a868dc0af Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Tue, 31 Jan 2023 11:09:33 +0100 Subject: [PATCH] refactor: Reduce payload size when fetching workflows to prevent memory issues (#5293) --- packages/cli/src/executions/executions.service.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/executions/executions.service.ts b/packages/cli/src/executions/executions.service.ts index fe1e857d77..8a5ad8b82b 100644 --- a/packages/cli/src/executions/executions.service.ts +++ b/packages/cli/src/executions/executions.service.ts @@ -223,8 +223,19 @@ export class ExecutionsService { }); } - let query = Db.collections.Execution.createQueryBuilder() - .select() + // Omit `data` from the Execution since it is the largest and not necesary for the list. + let query = Db.collections.Execution.createQueryBuilder('execution') + .select([ + 'execution.id', + 'execution.finished', + 'execution.mode', + 'execution.retryOf', + 'execution.retrySuccessId', + 'execution.waitTill', + 'execution.startedAt', + 'execution.stoppedAt', + 'execution.workflowData', + ]) .orderBy('id', 'DESC') .take(limit) .where(findWhere);