async def _close_page(self, page: Page) -> None: logger.info(f"Removing page: {page}") if page in self.idle_page_q._queue: # remove page from idle queue. self.idle_page_q._queue.remove(page) del self.pages[page] try: # wait for page to close. await asyncio.wait_for(page.close(), timeout=2) except asyncio.TimeoutError: logger.warning(f"Page {page} could not be properly closed.")
async def close_page(self, page: Page) -> None: """Attempt to close a page.""" try: await asyncio.wait_for(page.close(), timeout=2) except Exception: self.logger.warning(f"Page {page} could not be properly closed.")