Исправить замечания ревью кода: убрать повтор в AppendOnce за счёт запаса у чистки ключей, вынести MessagePayload и SameContent, принять X-Request-Id от балансировщика, упростить фоновые задачи сервера, сократить комментарии

This commit is contained in:
2026-11-04 12:19:49 +03:00
parent c9d0f73221
commit 7fbd781ca3
25 changed files with 207 additions and 247 deletions
+2 -5
View File
@@ -39,10 +39,8 @@ type Deps struct {
MaxBodyBytes int64
// RequestTimeout bounds every API request; zero means the default.
RequestTimeout time.Duration
// InstanceID is sent as X-Instance-Id on every response.
InstanceID string
// IdempotencyTTL is how long a message Idempotency-Key is remembered;
// zero means the default.
InstanceID string
// IdempotencyTTL zero means the contract's 24 hours.
IdempotencyTTL time.Duration
}
@@ -50,7 +48,6 @@ type Deps struct {
// request that gives up on a dependency can still write its 503.
const defaultRequestTimeout = 5 * time.Second
// defaultIdempotencyTTL is the contract's retention of message keys.
const defaultIdempotencyTTL = 24 * time.Hour
func New(d Deps) *App {