32 lines
726 B
Go
32 lines
726 B
Go
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
|
|
}
|