forked from mtusi2026/mtusi2026lab5
lab5: асинхронная очередь, worker и идемпотентный pipeline
API принимает 202 после durable staging и TX intent (job+outbox); отдельные relay и worker публикуют/обрабатывают задания с publisher confirm, lease, retry/backoff, DLQ и replay. Добавлены версии pipeline, варианты thumbnail/crop/optimized, presign в verified staging, status-aware sweeper и admission control.
This commit is contained in:
@@ -38,3 +38,13 @@ WHERE actor_id = sqlc.arg(actor_id)
|
||||
SELECT id, chat_id, sender_id, text, created_at
|
||||
FROM messages
|
||||
WHERE id = sqlc.arg(id);
|
||||
|
||||
-- Read-only replay lookup used before attachment-state validation. A live key
|
||||
-- returns the stored message; an expired key is ignored and may be claimed.
|
||||
-- name: LookupMessageIdempotency :one
|
||||
SELECT message_id, request_hash
|
||||
FROM message_idempotency
|
||||
WHERE actor_id = sqlc.arg(actor_id)
|
||||
AND chat_id = sqlc.arg(chat_id)
|
||||
AND key = sqlc.arg(key)
|
||||
AND expires_at > now();
|
||||
|
||||
Reference in New Issue
Block a user