From 4f3e91e50eed4ea01d46c774fd98e4b7cc7aa5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=BE=D0=BB=D0=B8=D0=BA=D0=BE=D0=B2=20Maximillian?= =?UTF-8?q?=20=D0=90=D0=BD=D1=82=D0=BE=D0=BD?= Date: Sun, 8 Nov 2026 15:21:12 +0300 Subject: [PATCH] feat(worker): create pipeline skeleton --- backend/internal/worker/pipeline.go | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 backend/internal/worker/pipeline.go diff --git a/backend/internal/worker/pipeline.go b/backend/internal/worker/pipeline.go new file mode 100644 index 0000000..77150f8 --- /dev/null +++ b/backend/internal/worker/pipeline.go @@ -0,0 +1,31 @@ +package worker + +import ( + "context" + "log" + "time" + + "high-loud-apps-labs/internal/domain" +) + +type Pipeline struct { + jobs domain.AttachmentJobRepository + store domain.ObjectStorage + variants domain.AttachmentVariantRepository + lease time.Duration +} + +func NewPipeline(jobs domain.AttachmentJobRepository, store domain.ObjectStorage, variants domain.AttachmentVariantRepository) *Pipeline { + return &Pipeline{ + jobs: jobs, + store: store, + variants: variants, + lease: 5 * time.Minute, + } +} + +func (p *Pipeline) Process(ctx context.Context, attachmentID string) error { + log.Printf("worker: получена задача на обработку %s (заглушка)", attachmentID) + // TODO + return nil +}