Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
fix: cleanup not available on development env
Browse files Browse the repository at this point in the history
  • Loading branch information
Mar0xy committed Nov 12, 2023
1 parent b7fc13e commit bc25b28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/backend/src/misc/create-temp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function createTemp(): Promise<[string, () => void]> {
return new Promise<[string, () => void]>((res, rej) => {
tmp.file((e, path, fd, cleanup) => {
if (e) return rej(e);
res([path, process.env.NODE_ENV === 'production' ? cleanup : () => {}]);
res([path, process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'development' ? cleanup : () => {}]);
});
});
}
Expand All @@ -22,7 +22,7 @@ export function createTempDir(): Promise<[string, () => void]> {
},
(e, path, cleanup) => {
if (e) return rej(e);
res([path, process.env.NODE_ENV === 'production' ? cleanup : () => {}]);
res([path, process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'development' ? cleanup : () => {}]);
},
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class ImportNotesProcessorService {
return;
}

const type = job.data.type ?? '';
const type = job.data.type;

if (type === 'Twitter' || file.name.startsWith('twitter') && file.name.endsWith('.zip')) {
const [path, cleanup] = await createTempDir();
Expand Down

0 comments on commit bc25b28

Please sign in to comment.