From fb0b64c36c1ddd77b681d068453a53ce00577505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20X=2E=20F=C3=BCrst?= Date: Fri, 5 Jun 2026 14:06:17 +0200 Subject: [PATCH] fix: backup blockiert HTTP-Response nicht mehr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setImmediate() startet Backup außerhalb des Next.js Request-Kontexts, ConnectTimeout=15 verhindert hängende SSH-Verbindungen. Co-Authored-By: Claude Sonnet 4.6 --- lib/backup.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/backup.ts b/lib/backup.ts index 0e6476f..db51aca 100644 --- a/lib/backup.ts +++ b/lib/backup.ts @@ -1,7 +1,7 @@ import { spawn } from 'child_process'; export function triggerBackup(): void { - runBackup().catch((e) => console.error('[backup] Fehler:', e)); + setImmediate(() => runBackup().catch((e) => console.error('[backup] Fehler:', e))); } async function runBackup(): Promise { @@ -32,6 +32,7 @@ async function runBackup(): Promise { ...(keyPath ? ['-i', keyPath] : []), '-o', 'StrictHostKeyChecking=no', '-o', 'BatchMode=yes', + '-o', 'ConnectTimeout=15', ]; const dumpBin = process.env.BACKUP_DUMP_CMD || 'mariadb-dump';