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. ---"