Implement durable image processing pipeline with outbox and recovery

This commit is contained in:
Polusikkkk
2026-11-17 18:48:50 +03:00
parent 276dbdad8a
commit be223efc8b
84 changed files with 8982 additions and 18 deletions
+13
View File
@@ -0,0 +1,13 @@
CREATE TABLE attachment_job_replays (
id UUID PRIMARY KEY,
job_id UUID NOT NULL REFERENCES attachment_jobs(id),
actor TEXT NOT NULL CHECK (char_length(actor) BETWEEN 1 AND 100),
reason TEXT NOT NULL CHECK (char_length(reason) BETWEEN 1 AND 500),
previous_attempt INTEGER NOT NULL CHECK (previous_attempt >= 1),
new_attempt INTEGER NOT NULL,
previous_error_code TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp(),
CHECK (new_attempt = previous_attempt + 1),
UNIQUE (job_id, new_attempt)
);