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:
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/google/uuid"
|
||||
|
||||
"mtusi-messenger/internal/config"
|
||||
"mtusi-messenger/internal/imageproc"
|
||||
"mtusi-messenger/internal/logger"
|
||||
"mtusi-messenger/internal/storage/postgres"
|
||||
)
|
||||
@@ -109,6 +110,10 @@ func runReprocess(ctx context.Context, repo *postgres.PipelineRepository, cfg co
|
||||
version := flags.Int("pipeline", 2, "target pipeline version")
|
||||
_ = flags.Parse(os.Args[2:])
|
||||
|
||||
if _, ok := imageproc.Pipeline(*version); !ok {
|
||||
fail(fmt.Errorf("unsupported pipeline version %d", *version))
|
||||
}
|
||||
|
||||
id, err := uuid.Parse(*attachmentID)
|
||||
if err != nil {
|
||||
fail(fmt.Errorf("invalid attachment id: %w", err))
|
||||
|
||||
Reference in New Issue
Block a user