From 54a9c975258557c5a4276473787e2e44557608db Mon Sep 17 00:00:00 2001 From: Terranom674 Date: Thu, 3 Sep 2026 12:58:54 +0200 Subject: [PATCH] Preserve warmup worker exit codes in guard --- runtime/lib/run-webdav-cache-warmup.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/runtime/lib/run-webdav-cache-warmup.sh b/runtime/lib/run-webdav-cache-warmup.sh index ad363b6..7a47921 100644 --- a/runtime/lib/run-webdav-cache-warmup.sh +++ b/runtime/lib/run-webdav-cache-warmup.sh @@ -20,14 +20,10 @@ flock -s 9 COMMAND=("$@") -run_command() { - "${COMMAND[@]}" -} - -result=0 -if ! run_command; then - result=$? -fi +set +e +"${COMMAND[@]}" +result=$? +set -e # Ein Connector-Sync kann während eines bereits laufenden Warmups neue Alben # melden. Der Dispatcher legt dafür nur eine Prioritätsmarke an; er startet @@ -50,8 +46,12 @@ if [[ -f "$PRIORITY_FILE" ]]; then SYNC_COMMAND+=("--mode=sync") fi - if ! "${SYNC_COMMAND[@]}"; then - result=$? + set +e + "${SYNC_COMMAND[@]}" + sync_result=$? + set -e + if [[ "$sync_result" -ne 0 ]]; then + result="$sync_result" fi fi