From 06c0366d2ae30fbf73dd52bce26c38fa1f2ec4c1 Mon Sep 17 00:00:00 2001 From: TPV Date: Thu, 16 Jul 2026 05:36:52 -0700 Subject: [PATCH] readded pre_task_func for functions that must promise order --- src/monitor_utils/runner.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/monitor_utils/runner.py b/src/monitor_utils/runner.py index c334400..89487d7 100644 --- a/src/monitor_utils/runner.py +++ b/src/monitor_utils/runner.py @@ -213,6 +213,11 @@ async def execute_monitor_logic( proxies: Proxies applied to the session. headers: Headers applied to the session. cookies: Cookies applied to the base session; ignored for TLS. + pre_task_func: Optional awaitable run once per cycle, awaited before any + category tasks are dispatched and receiving session and **kwargs. + Use it for setup the category tasks depend on (session headers, + cookies, fetched state); if it raises an expected task error the + cycle is skipped and retried after the usual delay. concurrent_pre_task_func: Optional awaitable run once per cycle, gathered alongside the category tasks and receiving session and **kwargs. Category tasks must not depend on its side effects (session