perf(core): Skip unneeded calls on every pruning cycle (#7260)

This commit is contained in:
Iván Ovejero
2023-09-26 16:53:38 +02:00
committed by GitHub
parent 0824800dff
commit db01164ce1

View File

@@ -521,6 +521,11 @@ export class ExecutionRepository extends Repository<ExecutionEntity> {
}) })
).map(({ id }) => id); ).map(({ id }) => id);
if (executionIds.length === 0) {
this.logger.debug('Found no executions to hard-delete from database');
return;
}
await this.binaryDataService.deleteManyByExecutionIds(executionIds); await this.binaryDataService.deleteManyByExecutionIds(executionIds);
this.logger.debug(`Hard-deleting ${executionIds.length} executions from database`, { this.logger.debug(`Hard-deleting ${executionIds.length} executions from database`, {