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:
@@ -113,7 +113,7 @@ func declareTopology(channel *amqp.Channel, cfg Config) error {
|
||||
|
||||
queue, err := channel.QueueDeclare(cfg.Queue, true, false, false, false, amqp.Table{
|
||||
"x-queue-type": "quorum",
|
||||
"x-delivery-limit": int32(8),
|
||||
"x-delivery-limit": int32(100),
|
||||
"x-delayed-retry-type": "all",
|
||||
"x-delayed-retry-min": int32(5000),
|
||||
"x-delayed-retry-max": int32(60000),
|
||||
@@ -186,7 +186,14 @@ func (c *Client) PublishConfirmed(ctx context.Context, routingKey string, messag
|
||||
return fmt.Errorf("publish job: %w", err)
|
||||
}
|
||||
|
||||
confirmed, err := confirmation.WaitContext(ctx)
|
||||
confirmCtx := ctx
|
||||
if c.cfg.ConfirmTimeout > 0 {
|
||||
var cancel context.CancelFunc
|
||||
confirmCtx, cancel = context.WithTimeout(ctx, c.cfg.ConfirmTimeout)
|
||||
defer cancel()
|
||||
}
|
||||
|
||||
confirmed, err := confirmation.WaitContext(confirmCtx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("await publisher confirm: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user