lab5: закрытие второго ревью
Validate the PNG raster itself: exact Adam7/non-interlaced row layout, scanline filter bytes, palette/PLTE rules, bounded streaming without keeping the raster. Settle an attachment as failed when a newer pipeline fails before any version was published, while keeping a ready serving version intact. Reject unsupported pipeline versions in jobctl before changing state.
This commit is contained in:
@@ -998,7 +998,15 @@ func failJobTx(
|
||||
return fmt.Errorf("mark job failed: %w", mapError(err))
|
||||
}
|
||||
|
||||
if job.PipelineVersion == attachment.PipelineVersion {
|
||||
// A failed job settles the attachment when its version is the serving one,
|
||||
// or when it is a newer version attempted before any version was
|
||||
// published (reprocess from queued/processing/failed). A newer version
|
||||
// failing while an older ready version is serving must not disturb the
|
||||
// published version: it stays ready and downloadable.
|
||||
settlesAttachment := job.PipelineVersion == attachment.PipelineVersion ||
|
||||
(job.PipelineVersion > attachment.PipelineVersion && attachment.Status != domain.AttachmentReady)
|
||||
|
||||
if settlesAttachment {
|
||||
_, err = tx.Exec(ctx, `
|
||||
UPDATE attachments
|
||||
SET status = 'failed',
|
||||
|
||||
Reference in New Issue
Block a user