Исправить замечания ревью кода: убрать повтор в 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
@@ -146,11 +146,8 @@ func TestLogoutRevokesOnlyTheCurrentToken(t *testing.T) {
ts.expect(ts.do(http.MethodGet, "/api/v1/users/me", other.Token, nil, nil), http.StatusOK, "")
}
// The expiry is an absolute time written by the application and enforced by
// Valkey's clock. Here the test runs on the Windows host and Valkey in the
// Docker VM, whose clock lags by a fraction of a second, so the test waits
// for the 401 with a tolerance instead of sleeping exactly one TTL. On the
// stand both run in the same VM.
// Valkey enforces the expiry by the Docker VM clock, which may lag this host
// by a fraction of a second, so the 401 is awaited with a tolerance.
func TestSessionExpiresAfterTTL(t *testing.T) {
const ttl, clockTolerance = 2 * time.Second, 3 * time.Second
ts := newTesterWithTTL(t, ttl)