Skip to content

Commit a32b24a

Browse files
Handle timeout when closing old permanent browser
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 3a8ca10 commit a32b24a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎deploy/docker/crawler_pool.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,12 @@ async def restart_permanent(cfg: BrowserConfig):
161161
old, PERMANENT = PERMANENT, None
162162

163163
if old:
164-
with suppress(Exception):
165-
await old.close()
164+
try:
165+
await asyncio.wait_for(old.close(), timeout=60)
166+
except asyncio.TimeoutError:
167+
logger.warning("Timed out closing old permanent browser; continuing restart")
168+
except Exception:
169+
pass
166170

167171
await init_permanent(cfg)
168172

0 commit comments

Comments
 (0)