lab5: исправления по ревью

Concurrent complete no longer deletes the shared verified source; admission is atomic and covers pending presign rows; relay reconciles queued jobs lost to dead-lettering; failed staging is protected until failed_retention; timestamps normalized to UTC; reprocess prefers the durable original and keeps job->attachment lock order; heartbeat errors no longer burn attempts; confirm timeout enforced; pinned images and sanitized health responses.
This commit is contained in:
Vladislav Kunetskiy
2026-10-30 23:13:44 +03:00
parent 4bdcac3dfa
commit 9d7a0acb5a
40 changed files with 592 additions and 521 deletions
+5 -9
View File
@@ -17,12 +17,11 @@ type Store struct {
queryTimeout time.Duration
idempotencyTTL time.Duration
users *UserRepository
chats *ChatRepository
messages *MessageRepository
sessions *SessionRepository
attachments *AttachmentRepository
pipeline *PipelineRepository
users *UserRepository
chats *ChatRepository
messages *MessageRepository
sessions *SessionRepository
pipeline *PipelineRepository
}
func New(ctx context.Context, cfg config.Postgres, idempotencyTTL time.Duration) (*Store, error) {
@@ -67,7 +66,6 @@ func New(ctx context.Context, cfg config.Postgres, idempotencyTTL time.Duration)
store.chats = &ChatRepository{store: store}
store.messages = &MessageRepository{store: store}
store.sessions = &SessionRepository{store: store}
store.attachments = &AttachmentRepository{store: store}
store.pipeline = &PipelineRepository{store: store}
return store, nil
@@ -81,8 +79,6 @@ func (s *Store) Messages() *MessageRepository { return s.messages }
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 {