Исправить замечания ревью кода: убрать повтор в 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
+1 -4
View File
@@ -6,10 +6,7 @@ import (
"time"
)
// RunKeyCleanup deletes expired Idempotency-Keys every period until ctx is
// cancelled. Every replica runs it: the deletes skip rows another replica or
// a request holds, so concurrent runs share the work instead of waiting, and
// a failed run is simply retried at the next tick.
// RunKeyCleanup purges expired Idempotency-Keys every period until ctx is done.
func RunKeyCleanup(ctx context.Context, log *slog.Logger, svc *Service, every time.Duration) {
ticker := time.NewTicker(every)
defer ticker.Stop()