From 895f517d9d3c81ab9bf9c23a1701f1e00fa5f507 Mon Sep 17 00:00:00 2001 From: vegard Date: Tue, 17 Mar 2026 22:21:11 +0000 Subject: [PATCH] =?UTF-8?q?Fiks=20run-tasks.sh:=20unng=C3=A5=20set=20-e=20?= =?UTF-8?q?krasj=20ved=20exitkode-h=C3=A5ndtering?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ((completed++)) returnerer 1 når completed=0 under set -e. Bytter til $((x + 1)) og fanger exitkode med || exit_code=$?. Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/run-tasks.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/run-tasks.sh b/scripts/run-tasks.sh index d11878e..e8c09e5 100755 --- a/scripts/run-tasks.sh +++ b/scripts/run-tasks.sh @@ -48,11 +48,11 @@ while true; do echo "" # Kjør oppgaven - ./scripts/run-next-task.sh - exit_code=$? + exit_code=0 + ./scripts/run-next-task.sh || exit_code=$? if [[ $exit_code -eq 0 ]]; then - ((completed++)) + completed=$((completed + 1)) api_failures=0 # Nullstill ved suksess echo "" echo "--- Oppgave ferdig (#$completed). Neste om ${INTERVAL}s (Ctrl-C for å stoppe) ---" @@ -71,7 +71,7 @@ while true; do fi # Oppgaven ble tilbakestilt til [ ] — sannsynligvis API-feil - ((api_failures++)) + api_failures=$((api_failures + 1)) if [[ $api_failures -ge $MAX_API_RETRIES ]]; then echo "" echo "--- $MAX_API_RETRIES feil på rad. Stopper. ---"