Files
mtusi2026lab2/config_example.toml
T
ricoromaandClaude Opus 5.5 cae4b09147 feat: cache chat cards in Valkey
Valkey 9.1 in compose caches the immutable chat card (title, members,
created_at) used by GET /chats/{id} and by the membership check of the
message endpoints. Cache-aside with a write after commit, keys per
database, TTL plus allkeys-lru, persistence off. redis-py runs without
retries; on failure the cache is skipped for a few seconds and requests
go to PostgreSQL. Readiness does not depend on Valkey.

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

46 lines
2.4 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