fix: narrow backup scope to database and telegram sessions

This commit is contained in:
2026-07-22 09:31:07 +02:00
parent 3536089d52
commit 03822e0763
10 changed files with 174 additions and 186 deletions
+9
View File
@@ -1,3 +1,4 @@
import path from "path";
import { rm } from "fs/promises";
import { db } from "./db/client.js";
import { childLogger } from "./util/logger.js";
@@ -199,4 +200,12 @@ export async function processManualUpload(uploadId: string): Promise<void> {
data: { status: "FAILED", errorMessage: message },
});
}
// Clean up uploaded files
try {
const uploadDir = path.join("/data/uploads", uploadId);
await rm(uploadDir, { recursive: true, force: true });
} catch {
// Best-effort cleanup
}
}