Files
momentry_core/migrations/20261012_add_command_timeout.sql
Accusys 667e279768 release: v1.3.5 - merge Phase 1 (health/queue API + timeout_at self-heal) onto v1.3.4 base
- Add /api/v1/health/queue queue-health endpoint (public, like /health/detailed)
- Add timeout_at column + index (migration 20261012_add_command_timeout.sql)
- consume() stamps timeout_at; pipeline_worker self-heals timed-out commands every 5m
- Bump version 1.3.4 -> 1.3.5
2026-10-13 00:12:05 +08:00

15 lines
643 B
SQL

-- Migration: Add timeout_at to command_queue
-- Date: 2026-10-12
-- Purpose: Pipeline Worker timeout / self-healing (Phase 1 of pipeline worker refactor)
-- consume() stamps timeout_at = NOW() + timeout_seconds; the worker monitor
-- task and the external command_monitor reset rows whose timeout_at has passed.
ALTER TABLE command_queue
ADD COLUMN IF NOT EXISTS timeout_at TIMESTAMP WITH TIME ZONE;
COMMENT ON COLUMN command_queue.timeout_at IS 'Command timeout timestamp (set on consume, cleared on reset)';
CREATE INDEX IF NOT EXISTS idx_command_queue_timeout
ON command_queue(timeout_at)
WHERE status = 'processing';