fix(storage): read lab5 job fields in GetByID
This commit is contained in:
@@ -71,7 +71,8 @@ func (r *AttachmentRepo) CreateInTx(ctx context.Context, tx domain.Tx, a *domain
|
|||||||
func (r *AttachmentRepo) GetByID(ctx context.Context, id string) (*domain.Attachment, error) {
|
func (r *AttachmentRepo) GetByID(ctx context.Context, id string) (*domain.Attachment, error) {
|
||||||
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
|
||||||
FROM attachments
|
FROM attachments
|
||||||
WHERE id = $1::uuid
|
WHERE id = $1::uuid
|
||||||
`
|
`
|
||||||
@@ -80,7 +81,8 @@ func (r *AttachmentRepo) GetByID(ctx context.Context, id string) (*domain.Attach
|
|||||||
err := r.pool.QueryRow(ctx, q, id).
|
err := r.pool.QueryRow(ctx, q, id).
|
||||||
Scan(&a.ID, &a.ChatID, &a.OwnerID, &a.Filename, &a.ContentType,
|
Scan(&a.ID, &a.ChatID, &a.OwnerID, &a.Filename, &a.ContentType,
|
||||||
&a.SizeBytes, &a.SHA256, &a.ObjectKey, &status, &a.ErrorCode,
|
&a.SizeBytes, &a.SHA256, &a.ObjectKey, &status, &a.ErrorCode,
|
||||||
&a.CreatedAt, &a.UpdatedAt)
|
&a.CreatedAt, &a.UpdatedAt,
|
||||||
|
&a.Attempts, &a.NextAttemptAt, &a.LockedUntil, &a.PipelineVersion, &a.StagingKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, notFound(err, "attachment", id)
|
return nil, notFound(err, "attachment", id)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user