fix(storage): lab6 read attachments after clearing staging

This commit is contained in:
Голиков Maximillian Антон
2026-12-01 16:21:47 +03:00
parent 3efc70838e
commit 86fb7d7dba
@@ -72,7 +72,7 @@ func (r *AttachmentRepo) GetByID(ctx context.Context, id string) (*domain.Attach
const q = `
SELECT id, chat_id, owner_id, filename, content_type, size_bytes, sha256,
object_key, status, error_code, created_at, updated_at,
attempts, next_attempt_at, locked_until, pipeline_version, staging_key
attempts, next_attempt_at, locked_until, pipeline_version, COALESCE(staging_key, '')
FROM attachments
WHERE id = $1::uuid
`
@@ -280,7 +280,7 @@ func (r *AttachmentRepo) ListExpiredLeases(ctx context.Context, limit int) ([]do
const q = `
SELECT id, chat_id, owner_id, filename, content_type, size_bytes, sha256,
object_key, status, error_code, created_at, updated_at,
attempts, next_attempt_at, locked_until, pipeline_version, staging_key
attempts, next_attempt_at, locked_until, pipeline_version, COALESCE(staging_key, '')
FROM attachments
WHERE status = 'processing' AND locked_until < now()
ORDER BY locked_until