Skip to content

Commit

Permalink
Add wait to after sneding browser.close()
Browse files Browse the repository at this point in the history
  • Loading branch information
ayjayt committed Jan 29, 2025
1 parent 18b35c9 commit dd5ab73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion choreographer/browser_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ async def _close(self) -> None:
return
except ChannelClosedError:
_logger.debug("Can send browser.close on close channel")
await asyncio.sleep(0.3)
await asyncio.to_thread(self._channel.close)
if await self._is_closed(wait=2):
return

if await self._is_closed():
_logger.debug("Browser is closed after closing channel")
Expand Down

0 comments on commit dd5ab73

Please sign in to comment.