mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-27 23:07:12 +02:00
fix(core): Remove aggressive temp directory cleanup in binary data rename (#31068)
Some checks are pending
Build: Benchmark Image / build (push) Waiting to run
CI: Master (Build, Test, Lint) / Build for Github Cache (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (22.22.3) (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (24.15.0) (push) Waiting to run
CI: Master (Build, Test, Lint) / Lint (push) Waiting to run
CI: Master (Build, Test, Lint) / Performance (push) Waiting to run
CI: Master (Build, Test, Lint) / Notify Slack on failure (push) Blocked by required conditions
Util: Sync API Docs / sync-public-api (push) Waiting to run
Some checks are pending
Build: Benchmark Image / build (push) Waiting to run
CI: Master (Build, Test, Lint) / Build for Github Cache (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (22.22.3) (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (24.15.0) (push) Waiting to run
CI: Master (Build, Test, Lint) / Lint (push) Waiting to run
CI: Master (Build, Test, Lint) / Performance (push) Waiting to run
CI: Master (Build, Test, Lint) / Notify Slack on failure (push) Blocked by required conditions
Util: Sync API Docs / sync-public-api (push) Waiting to run
This commit is contained in:
parent
1f41d33852
commit
10a04cb209
|
|
@ -207,7 +207,7 @@ describe('deleteMany()', () => {
|
|||
});
|
||||
|
||||
describe('rename()', () => {
|
||||
it('should rename a file', async () => {
|
||||
it('should rename a file without deleting the temp directory', async () => {
|
||||
fsp.rename = jest.fn().mockResolvedValue(undefined);
|
||||
fsp.rm = jest.fn().mockResolvedValue(undefined);
|
||||
|
||||
|
|
@ -221,5 +221,6 @@ describe('rename()', () => {
|
|||
expect(fsp.rename).toHaveBeenCalledTimes(2);
|
||||
expect(fsp.rename).toHaveBeenCalledWith(oldPath, newPath);
|
||||
expect(fsp.rename).toHaveBeenCalledWith(`${oldPath}.metadata`, `${newPath}.metadata`);
|
||||
expect(fsp.rm).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -131,11 +131,6 @@ export class FileSystemManager implements BinaryData.Manager {
|
|||
fs.rename(oldPath, newPath),
|
||||
fs.rename(`${oldPath}.metadata`, `${newPath}.metadata`),
|
||||
]);
|
||||
|
||||
const [tempDirParent] = oldPath.split('/temp/');
|
||||
const tempDir = path.join(tempDirParent, 'temp');
|
||||
|
||||
await fs.rm(tempDir, { recursive: true });
|
||||
}
|
||||
|
||||
async deleteManyByFileId(ids: string[]): Promise<void> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user