Files
mtusi2026lab2/config_example.toml
T
ricoromaandClaude Opus 5.5 d7c9a5972b fix: retry Valkey once on a dropped connection
The client passed the sync redis.retry.Retry to async connections, so no
retry could ever run. Use redis.asyncio.retry.Retry with one immediate
retry on ConnectionError only: after a Valkey restart the stale pooled
connection is reopened instead of switching the cache off for 5 s.
Timeouts are not retried, and asyncio.timeout bounds each cache command
(pool wait, connect, retry, reply) by [cache] timeout_seconds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 21:41:15 +03:00

47 lines
2.5 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Шаблон config.toml: `make env_setup` копирует его, не перезаписывая
# существующий файл. Приоритет: окружение > .env > config.toml >
# значения по умолчанию. Любой параметр можно задать и через
# окружение: SECTION__FIELD, например APP__LOG_LEVEL.
[app]
# Режим (console / docker) задают Makefile, Dockerfile и compose через
# APP__RUN_MODE, а порт — APP__PORT в .env; здесь их не указывать.
log_level = "INFO"
# сколько секунд uvicorn ждёт текущие запросы после SIGTERM
graceful_shutdown_seconds = 8
[database]
# Адрес, порт, пользователь, пароль и имя базы приходят из .env (мосты к
# POSTGRES_*) и из environment compose; здесь их не указывать.
pool_size = 10
max_overflow = 5
# секунды ожидания свободного соединения пула
pool_timeout_seconds = 5
# секунды на установку соединения
connect_timeout_seconds = 3
# миллисекунды, серверный statement_timeout; 0 — без ограничения
statement_timeout_ms = 5000
# секунды на всю работу запроса с БД: зависший сервер, обрыв сети
request_timeout_seconds = 6
[auth]
# секунды жизни сессии с момента входа (контрактное имя
# SESSION_TTL_SECONDS); короткий срок для проверки истечения — окружением
# AUTH__SESSION_TTL_SECONDS=2
session_ttl_seconds = 3600
# сколько хэшей пароля Argon2id считается одновременно: 64 MiB на каждый
kdf_concurrency = 4
[cache]
# Адрес, порт и пароль Valkey приходят из .env (мосты к VALKEY_*) и из
# environment compose; здесь их не указывать.
# секунды на всю команду Valkey (ожидание пула, соединение, ответ);
# дольше — запрос идёт в PostgreSQL
timeout_seconds = 0.2
# секунды, на которые кэш пропускается после отказа Valkey
retry_after_seconds = 5
# секунды жизни карточки чата в кэше
chat_ttl_seconds = 3600
# соединений в пуле клиента Valkey
max_connections = 10