feat(worker): lab5 implement thumbnail generation and complete job logic
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user