Poller: a failed run's HTTP error is closed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
271c230635
commit
51b02e426d
1 file changed
+2
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user