forked from mtusi2026/mtusi2026lab7
feat: separate PostgreSQL roles and Valkey ACL per service
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vendored
+7
-1
@@ -232,13 +232,19 @@ def create_cache(
|
||||
# соединение, а обычный пул сразу бросал бы MaxConnectionsError, и
|
||||
# здоровый Valkey пропускался бы как отказавший.
|
||||
# Retry — из redis.asyncio: синхронный класс асинхронное соединение
|
||||
# вызывает через await, и повтор молча не выполняется
|
||||
# вызывает через await, и повтор молча не выполняется.
|
||||
# Пользователь ACL — [cache] username (change storage-roles, design,
|
||||
# решение 9); driver_info=None — без CLIENT SETINFO при соединении: у
|
||||
# пользователя api этой команды нет, и каждое соединение оставляло бы
|
||||
# отказ в ACL LOG (проба apply, задача 1.2)
|
||||
pool = BlockingConnectionPool(
|
||||
connection_class=TlsConnection,
|
||||
client_context=build_client_context(ca_file),
|
||||
host=cache.host,
|
||||
port=cache.port,
|
||||
username=cache.username or None,
|
||||
password=cache.password.get_secret_value() or None,
|
||||
driver_info=None,
|
||||
max_connections=cache.max_connections,
|
||||
timeout=cache.timeout_seconds,
|
||||
socket_timeout=cache.timeout_seconds,
|
||||
|
||||
Reference in New Issue
Block a user