This commit is contained in:
2026-11-20 22:48:28 +03:00
parent 276dbdad8a
commit 8e1f96b70b
46 changed files with 2345 additions and 49 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
set -eu
: "${ATTACHMENT_ID:?Set ATTACHMENT_ID to the failed attachment UUID}"
# Explicit operator action: only a failed job is moved back to the durable queue.
docker compose --env-file .env exec -T postgres psql -U "${POSTGRES_USER:-messenger}" -d "${POSTGRES_DB:-messenger}" -v ON_ERROR_STOP=1 \
-v attachment_id="$ATTACHMENT_ID" <<'SQL'
UPDATE attachment_jobs
SET status = 'queued', attempt = 0, next_attempt_at = now(), lease_until = NULL,
published_at = NULL, error_code = NULL, updated_at = now()
WHERE attachment_id = :'attachment_id' AND status = 'failed';
UPDATE attachments
SET status = 'queued', error_code = NULL, updated_at = now()
WHERE id = :'attachment_id' AND status = 'failed';
SQL