common_lib/common_lib/utils/http_client.py
2026-03-18 01:54:17 +03:00

16 lines
415 B
Python

import httpx
# from .ssl_transport import ssl_transport
# Ограничения пула соединений
limits = httpx.Limits(max_connections=1000, max_keepalive_connections=200)
# Таймауты
timeout = httpx.Timeout(connect=5.0, read=10.0, write=5.0, pool=10.0)
# Глобальный клиент
client = httpx.AsyncClient(
# transport=ssl_transport,
limits=limits,
timeout=timeout,
)