feat(worker): lab5 implement thumbnail generation and complete job logic

This commit is contained in:
Голиков Maximillian Антон
2026-11-09 12:39:59 +03:00
parent 872406773f
commit 22c876f63c
3 changed files with 34 additions and 11 deletions
+1 -2
View File
@@ -63,8 +63,7 @@ func (p *Pipeline) Process(ctx context.Context, attachmentID string) error {
}
// 4. Сохраняем оригинал в финальный prefix (chats/...)
// Внимание: a.ObjectKey уже содержит "chats/{chat_id}/{id}", заданный в API
if err := p.store.Put(ctx, a.ObjectKey, bytes.NewReader(buf), int64(len(buf)), "image/jpeg"); err != nil {
if err := p.store.Put(ctx, a.ObjectKey, bytes.NewReader(buf), int64(len(buf)), a.ContentType); err != nil {
_ = p.jobs.FailJob(ctx, a.ID, "storage_error")
return fmt.Errorf("загрузка оригинала: %w", err)
}