aboutsummaryrefslogtreecommitdiff
path: root/src/server/ActionUtilities.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/ActionUtilities.ts')
-rw-r--r--src/server/ActionUtilities.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/ActionUtilities.ts b/src/server/ActionUtilities.ts
index c155796a8..4fe7374d1 100644
--- a/src/server/ActionUtilities.ts
+++ b/src/server/ActionUtilities.ts
@@ -72,4 +72,8 @@ export async function Prune(rootDirectory: string): Promise<boolean> {
return error === null;
}
-export const Destroy = (mediaPath: string) => new Promise<boolean>(resolve => fs.unlink(mediaPath, error => resolve(error === null))); \ No newline at end of file
+export const Destroy = (mediaPath: string) => new Promise<boolean>(resolve => fs.unlink(mediaPath, error => resolve(error === null)));
+
+export function addBeforeExitHandler(handler: NodeJS.BeforeExitListener) {
+ process.on("beforeExit", handler);
+}