Poller: a failed run's HTTP error is closed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-24 16:49:05 +01:00
1 parent 271c230635
commit 51b02e426d
1 file changed
+2
+2
View File
@@ -136,6 +136,8 @@ def loop(run: Callable[[], int], every: int, log=print, sleep=time.sleep) -> Non
run()
except Exception as e: # noqa: BLE001 — the poller must outlive a failed run
log(f"run failed: {_describe(e)}")
if isinstance(e, urllib.error.HTTPError):
e.close()
sleep(every)