added passing headers

This commit is contained in:
TPV committed 2026-07-30 14:29:58 -07:00
1 parent 8903be2685
commit 2e6e7ebc69
2 files changed
+18 -4

No files matched your search

+3 -1
View File
@@ -344,6 +344,7 @@ async def run_bounded_cycle(
proxies: AioProxies,
collection: AsyncIOMotorCollection,
*,
headers: dict | None = None,
session_timeout: int = TIMEOUT_SECONDS,
max_clients: int = MAX_CURL_HANDLES,
cycle_timeout: int = CYCLE_TIMEOUT_SECONDS,
@@ -369,6 +370,7 @@ async def run_bounded_cycle(
task_func: Awaitable invoked per category.
proxies: Pool bound to each cycle's fresh session.
collection: Mongo collection forwarded to every callback.
headers: Monitor-wide static headers merged into every request.
session_timeout: Per-request timeout on the cycle's session.
max_clients: Curl handle pool size. Keep at or above the monitor's
whole fan-out; see get_default_session for why.
@@ -382,7 +384,7 @@ async def run_bounded_cycle(
"""
async with get_default_session(
proxies, timeout=session_timeout, max_clients=max_clients
proxies, headers, timeout=session_timeout, max_clients=max_clients
) as session:
try:
async with asyncio.timeout(cycle_timeout):