lab5: асинхронная очередь, worker и идемпотентный pipeline

API принимает 202 после durable staging и TX intent (job+outbox); отдельные relay и worker публикуют/обрабатывают задания с publisher confirm, lease, retry/backoff, DLQ и replay. Добавлены версии pipeline, варианты thumbnail/crop/optimized, presign в verified staging, status-aware sweeper и admission control.
This commit is contained in:
Vladislav Kunetskiy
2026-10-30 22:36:52 +03:00
parent 6c5ba026f1
commit 4bdcac3dfa
95 changed files with 8466 additions and 764 deletions
+4
View File
@@ -22,6 +22,7 @@ type Store struct {
messages *MessageRepository
sessions *SessionRepository
attachments *AttachmentRepository
pipeline *PipelineRepository
}
func New(ctx context.Context, cfg config.Postgres, idempotencyTTL time.Duration) (*Store, error) {
@@ -67,6 +68,7 @@ func New(ctx context.Context, cfg config.Postgres, idempotencyTTL time.Duration)
store.messages = &MessageRepository{store: store}
store.sessions = &SessionRepository{store: store}
store.attachments = &AttachmentRepository{store: store}
store.pipeline = &PipelineRepository{store: store}
return store, nil
}
@@ -81,6 +83,8 @@ func (s *Store) Sessions() *SessionRepository { return s.sessions }
func (s *Store) Attachments() *AttachmentRepository { return s.attachments }
func (s *Store) Pipeline() *PipelineRepository { return s.pipeline }
func (s *Store) Ping(ctx context.Context) error {
if err := s.pool.Ping(ctx); err != nil {
return fmt.Errorf("ping database: %w", err)