watchflow
watchflow copied to clipboard
fix: blocking time.sleep() in async retry path freezes event loop
While reading through the codebase, I noticed that src/rules/conditions/llm_assisted.py (line 221) uses time.sleep(wait_time) inside the async evaluate() method during LLM retry backoff.
Since time.sleep() is synchronous, it blocks the entire event loop during retries (2–8s with exponential backoff). This means any other webhook processing or API requests queued up will stall until the sleep completes.
Replacing with await asyncio.sleep(wait_time) fixes this — the event loop stays responsive while the retry waits.
This is a two-line change. Happy to open a PR with the fix.