From e75e4f11a20e989038f2a5ab8c3cd2a1c3b44e40 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Thu, 8 May 2025 16:42:16 -0400 Subject: match saveToTempFile return type with other create-temp function --- packages/backend/src/misc/create-temp.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/backend/src/misc') diff --git a/packages/backend/src/misc/create-temp.ts b/packages/backend/src/misc/create-temp.ts index fda63c7a9d..f2138abf66 100644 --- a/packages/backend/src/misc/create-temp.ts +++ b/packages/backend/src/misc/create-temp.ts @@ -30,11 +30,11 @@ export function createTempDir(): Promise<[string, () => void]> { }); } -export async function saveToTempFile(stream: NodeJS.ReadableStream): Promise { +export async function saveToTempFile(stream: NodeJS.ReadableStream): Promise<[string, () => void]> { const [filepath, cleanup] = await createTemp(); try { await pipeline(stream, fs.createWriteStream(filepath)); - return filepath; + return [filepath, cleanup]; } catch (e) { cleanup(); throw e; -- cgit v1.2.3-freya