feat(core): Switch binary filesystem mode to nested path structure (#7307)

Depends on #7253 | Story:
[PAY-863](https://linear.app/n8n/issue/PAY-863/switch-binary-filesystem-mode-to-nested-path-structure)

This PR introduces `filesystem-v2` to store binary data in the
filesystem in the same format as `s3`.
This commit is contained in:
Iván Ovejero
2023-10-10 10:06:06 +02:00
committed by GitHub
parent 86e7ec796a
commit 0847623f85
13 changed files with 326 additions and 186 deletions

View File

@@ -2,16 +2,13 @@ import fs from 'node:fs/promises';
import { ObjectStoreManager } from '@/BinaryData/ObjectStore.manager';
import { ObjectStoreService } from '@/ObjectStore/ObjectStore.service.ee';
import { isStream } from '@/ObjectStore/utils';
import { mockInstance, toStream } from './utils';
import { mockInstance, toFileId, toStream } from './utils';
jest.mock('fs/promises');
const objectStoreService = mockInstance(ObjectStoreService);
const objectStoreManager = new ObjectStoreManager(objectStoreService);
const toFileId = (workflowId: string, executionId: string, fileUuid: string) =>
`workflows/${workflowId}/executions/${executionId}/binary_data/${fileUuid}`;
const workflowId = 'ObogjVbqpNOQpiyV';
const executionId = '999';
const fileUuid = '71f6209b-5d48-41a2-a224-80d529d8bb32';