Исправить замечания ревью кода: убрать повтор в AppendOnce за счёт запаса у чистки ключей, вынести MessagePayload и SameContent, принять X-Request-Id от балансировщика, упростить фоновые задачи сервера, сократить комментарии
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user