fix(storage): lab6 read attachments after clearing staging
This commit is contained in:
@@ -72,7 +72,7 @@ func (r *AttachmentRepo) GetByID(ctx context.Context, id string) (*domain.Attach
|
|||||||
const q = `
|
const q = `
|
||||||
SELECT id, chat_id, owner_id, filename, content_type, size_bytes, sha256,
|
SELECT id, chat_id, owner_id, filename, content_type, size_bytes, sha256,
|
||||||
object_key, status, error_code, created_at, updated_at,
|
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
|
FROM attachments
|
||||||
WHERE id = $1::uuid
|
WHERE id = $1::uuid
|
||||||
`
|
`
|
||||||
@@ -280,7 +280,7 @@ func (r *AttachmentRepo) ListExpiredLeases(ctx context.Context, limit int) ([]do
|
|||||||
const q = `
|
const q = `
|
||||||
SELECT id, chat_id, owner_id, filename, content_type, size_bytes, sha256,
|
SELECT id, chat_id, owner_id, filename, content_type, size_bytes, sha256,
|
||||||
object_key, status, error_code, created_at, updated_at,
|
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
|
FROM attachments
|
||||||
WHERE status = 'processing' AND locked_until < now()
|
WHERE status = 'processing' AND locked_until < now()
|
||||||
ORDER BY locked_until
|
ORDER BY locked_until
|
||||||
|
|||||||
Reference in New Issue
Block a user