mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +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:
@@ -83,19 +83,6 @@ export class ObjectStoreManager implements BinaryData.Manager {
|
||||
return { fileId: targetFileId, fileSize: sourceFile.length };
|
||||
}
|
||||
|
||||
async deleteMany(ids: BinaryData.IdsForDeletion) {
|
||||
const prefixes = ids.map(
|
||||
({ workflowId, executionId }) =>
|
||||
`workflows/${workflowId}/executions/${executionId}/binary_data/`,
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
prefixes.map(async (prefix) => {
|
||||
await this.objectStoreService.deleteMany(prefix);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
async rename(oldFileId: string, newFileId: string) {
|
||||
const oldFile = await this.objectStoreService.get(oldFileId, { mode: 'buffer' });
|
||||
const oldFileMetadata = await this.objectStoreService.getMetadata(oldFileId);
|
||||
|
||||
Reference in New Issue
Block a user