From db01164ce11c2c1574899a60541d13712bb39324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 26 Sep 2023 16:53:38 +0200 Subject: [PATCH] perf(core): Skip unneeded calls on every pruning cycle (#7260) --- .../cli/src/databases/repositories/execution.repository.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/cli/src/databases/repositories/execution.repository.ts b/packages/cli/src/databases/repositories/execution.repository.ts index 051d206b54..1a68b75ba7 100644 --- a/packages/cli/src/databases/repositories/execution.repository.ts +++ b/packages/cli/src/databases/repositories/execution.repository.ts @@ -521,6 +521,11 @@ export class ExecutionRepository extends Repository { }) ).map(({ id }) => id); + if (executionIds.length === 0) { + this.logger.debug('Found no executions to hard-delete from database'); + return; + } + await this.binaryDataService.deleteManyByExecutionIds(executionIds); this.logger.debug(`Hard-deleting ${executionIds.length} executions from database`, {