lab5: очереди и асинхронная обработка изображений

Durable staging handoff, transactional outbox, at-least-once worker with lease fencing, idempotent versioned pipeline, three variants, operator tooling, contract tests and evidence. Includes the review fixes: reprocess source selection and failure settlement, replay guards, stale-job retirement, PNG structural/raster validation, migration rollback safety and audit events.
This commit is contained in:
Vladislav Kunetskiy
2026-10-31 14:34:24 +03:00
parent 6c5ba026f1
commit 01b885e846
99 changed files with 10164 additions and 1452 deletions
+15 -7
View File
@@ -74,23 +74,31 @@ func run(cfg config.Config, log *slog.Logger) error {
return fmt.Errorf("connect object store: %w", err)
}
attachmentRepository := store.Attachments()
pipelineRepository := store.Pipeline()
attachmentService := attachment.NewService(
attachmentRepository,
pipelineRepository,
objectStore,
attachment.Config{
MaxUploadBytes: cfg.S3.MaxUploadBytes,
MaxImagePixels: cfg.S3.MaxImagePixels,
PresignTTL: cfg.S3.PresignTTL,
MaxUploadBytes: cfg.S3.MaxUploadBytes,
MaxImagePixels: cfg.S3.MaxImagePixels,
PresignTTL: cfg.S3.PresignTTL,
PipelineVersion: cfg.Processing.PipelineVersion,
MaxAttempts: cfg.Processing.MaxAttempts,
MaxPendingPerUser: cfg.Admission.MaxPendingPerUser,
MaxPending: cfg.Admission.MaxPending,
MaxStagedBytes: cfg.Admission.MaxStagedBytes,
MaxConcurrent: cfg.Admission.MaxConcurrent,
},
log,
)
sweeper := attachment.NewSweeper(
attachmentRepository,
pipelineRepository,
objectStore,
store,
cfg.S3.SweepGrace,
cfg.Staging.OrphanGrace,
cfg.Staging.FailedRetention,
cfg.S3.SweepInterval,
log,
)
@@ -151,7 +159,7 @@ func run(cfg config.Config, log *slog.Logger) error {
rest.NewHandler(
user.NewService(store.Users()),
chat.NewService(chatRepo),
message.NewService(store.Messages(), attachmentRepository),
message.NewService(store.Messages(), pipelineRepository),
attachmentService,
health.New(pingers...),
sessionService,