init
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { unlink } from 'node:fs/promises';
|
||||
|
||||
export const removeFileFromDisk = async (path: string, logContext = 'removeFileFromDisk'): Promise<void> => {
|
||||
try {
|
||||
await unlink(path);
|
||||
} catch {
|
||||
Logger.error(`Failed to remove file ${path}`, logContext);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user