Миграции балансировка запросов идемпотентность graceful shutdown readines

This commit is contained in:
Dmitry
2026-10-27 21:33:13 +03:00
parent 6ddf0602ae
commit 36cbd70d37
13 changed files with 199 additions and 12 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ spring:
deserialization:
fail-on-unknown-properties: true
lifecycle:
timeout-per-shutdown-cycle=10s:
timeout-per-shutdown-phase: 20s
spring:
datasource:
@@ -59,7 +59,7 @@ logging:
:servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: DEBUG
server:
shutdown=graceful:
shutdown: graceful
management:
endpoints:
@@ -0,0 +1,10 @@
CREATE TABLE idempotency_keys (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id),
chat_id UUID NOT NULL REFERENCES chats(id),
idempotency_key VARCHAR(128) NOT NULL,
message_id UUID NOT NULL REFERENCES messages(id),
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
CONSTRAINT uq_idempotency_user_chat_key
UNIQUE (user_id, chat_id, idempotency_key)
);