mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Make pruning via lifecycle configuration in S3 mode mandatory (#7482)
Since we do not store which executions produced binary data, for pruning on S3 we need to query for binary data items for each execution in order to delete them. To minimize requests to S3, allow the user to skip pruning requests when setting TTL at bucket level.
This commit is contained in:
@@ -301,10 +301,7 @@ export class ExecutionRepository extends Repository<ExecutionEntity> {
|
||||
* Permanently remove a single execution and its binary data.
|
||||
*/
|
||||
async hardDelete(ids: { workflowId: string; executionId: string }) {
|
||||
return Promise.all([
|
||||
this.binaryDataService.deleteMany([ids]),
|
||||
this.delete({ id: ids.executionId }),
|
||||
]);
|
||||
return Promise.all([this.delete(ids.executionId), this.binaryDataService.deleteMany([ids])]);
|
||||
}
|
||||
|
||||
async updateExistingExecution(executionId: string, execution: Partial<IExecutionResponse>) {
|
||||
@@ -565,7 +562,7 @@ export class ExecutionRepository extends Repository<ExecutionEntity> {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.binaryDataService.deleteMany(workflowIdsAndExecutionIds);
|
||||
await this.binaryDataService.deleteMany(workflowIdsAndExecutionIds); // only in FS mode
|
||||
|
||||
this.logger.debug(
|
||||
`Hard-deleting ${executionIds.length} executions from database (pruning cycle)`,
|
||||
|
||||
Reference in New Issue
Block a user