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:
Vladislav Kunetskiy
2026-10-31 01:06:43 +03:00
parent b965350cc9
commit 8c0a455aa5
14 changed files with 478 additions and 112 deletions
+5
View File
@@ -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))