11 lines
323 B
TypeScript
11 lines
323 B
TypeScript
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);
|
|
}
|
|
};
|