From cc7fa01c10abd9cea87fb8dc9c870e700c82903d Mon Sep 17 00:00:00 2001 From: Terranom674 Date: Thu, 3 Sep 2026 12:47:46 +0200 Subject: [PATCH] Add WebDAV warmup dispatcher --- runtime/webdav-warmup-dispatch.php | 105 +++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 runtime/webdav-warmup-dispatch.php diff --git a/runtime/webdav-warmup-dispatch.php b/runtime/webdav-warmup-dispatch.php new file mode 100644 index 0000000..b996c84 --- /dev/null +++ b/runtime/webdav-warmup-dispatch.php @@ -0,0 +1,105 @@ +&1', $output, $exit); + foreach ($output as $line) fwrite(STDOUT, $line."\n"); + if ($exit !== 0) $result = $exit; + } + else + { + $command = 'nohup '.$base.' >> '.escapeshellarg($log).' 2>&1 < /dev/null & echo $!'; + $output = array(); + $exit = 1; + @exec($command, $output, $exit); + $pid = isset($output[0]) ? (int)$output[0] : 0; + if ($exit !== 0 || $pid <= 0) + { + fwrite(STDERR, "Warmup für Verbindung #{$connection_id} konnte nicht gestartet werden.\n"); + $result = 1; + continue; + } + $started++; + fwrite(STDOUT, "Warmup {$mode} für Verbindung #{$connection_id} gestartet (PID {$pid}).\n"); + } +} + +if (!$wait) fwrite(STDOUT, "Gestartete Warmup-Prozesse: {$started}.\n"); +exit($result);