fix(queue-daemon): implement timeout handling for long-running tasks #228

Merged
shoko merged 2 commits from fix/issue-166 into main 2026-04-08 04:51:54 +02:00
Showing only changes of commit fa8b8467ee - Show all commits

View File

@@ -50,7 +50,7 @@ check_task_completion() {
local hours_elapsed=$(( (now_epoch - notified_epoch) / 3600 ))
if [ "$hours_elapsed" -ge "${TASK_TIMEOUT_HOURS:-1}" ]; then
timed_out=true
echo "Task $queue_id ($issue_ref) timed out after ${hours_elapsed}h"
log_warn "queue-daemon" "Task $queue_id ($issue_ref) timed out after ${hours_elapsed}h"
fi
fi
@@ -62,7 +62,7 @@ check_task_completion() {
opencode session stop "$session_id" 2>/dev/null || true
fi
update_queue_item_state "$queue_id" "error"
echo "Task $queue_id ($issue_ref) marked error — timeout after ${hours_elapsed}h"
log_error "queue-daemon" "Task $queue_id ($issue_ref) marked error — timeout after ${hours_elapsed}h"
release_lock "$issue_ref"
return
fi