Fix critical bug: incorrect return code check in exit logic
The issue was in line 378: if [[ $? -eq 0 ]] - $? was checking the return code of 'local exit_reason=$(...)' - This command always succeeds, so $? was always 0 - This caused Ralph to always exit immediately after loop #1 Fixed by: - Calling should_exit_gracefully directly in the if condition - Only calling it again to get exit reason if it returns 0 (exit needed) - This properly checks the function's actual return code
This commit is contained in:
parent
a09957c068
commit
2a5452c18f
1 changed files with 2 additions and 2 deletions
|
|
@ -374,8 +374,8 @@ main() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for graceful exit conditions
|
# Check for graceful exit conditions
|
||||||
local exit_reason=$(should_exit_gracefully)
|
if should_exit_gracefully; then
|
||||||
if [[ $? -eq 0 ]]; then
|
local exit_reason=$(should_exit_gracefully)
|
||||||
log_status "SUCCESS" "🏁 Graceful exit triggered: $exit_reason"
|
log_status "SUCCESS" "🏁 Graceful exit triggered: $exit_reason"
|
||||||
update_status "$loop_count" "$(cat "$CALL_COUNT_FILE")" "graceful_exit" "completed" "$exit_reason"
|
update_status "$loop_count" "$(cat "$CALL_COUNT_FILE")" "graceful_exit" "completed" "$exit_reason"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue