Ensure background checker cancellation is not swallowed
Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/038b6d9a-0298-41d7-949f-40069cd3320f Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
bb07fbd2c3
commit
49e8a96aab
@@ -4401,6 +4401,7 @@ async def _background_domain_reachability_checker():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if domains_to_check:
|
if domains_to_check:
|
||||||
|
# Preserve domain order while removing duplicates.
|
||||||
unique_domains = list(dict.fromkeys(domains_to_check))
|
unique_domains = list(dict.fromkeys(domains_to_check))
|
||||||
results = await asyncio.gather(*[
|
results = await asyncio.gather(*[
|
||||||
loop.run_in_executor(None, _check_domain_reachable, domain)
|
loop.run_in_executor(None, _check_domain_reachable, domain)
|
||||||
@@ -4412,6 +4413,8 @@ async def _background_domain_reachability_checker():
|
|||||||
result["checked_at"] = checked_at
|
result["checked_at"] = checked_at
|
||||||
_domain_reachability_cache[domain] = result
|
_domain_reachability_cache[domain] = result
|
||||||
consecutive_failures = 0
|
consecutive_failures = 0
|
||||||
|
except asyncio.CancelledError:
|
||||||
|
raise
|
||||||
except Exception:
|
except Exception:
|
||||||
consecutive_failures += 1
|
consecutive_failures += 1
|
||||||
logger.exception("Background domain reachability checker error")
|
logger.exception("Background domain reachability checker error")
|
||||||
|
|||||||
Reference in New Issue
Block a user