File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -455,23 +455,22 @@ async def init(self):
455455 async def _init_playwright_with_timeout (self ):
456456 """
457457 Initialize playwright with a timeout to avoid hanging in strict event loop environments.
458-
458+
459459 This method adds a timeout to the regular async_playwright().start() to prevent
460460 hanging in environments that restrict blocking operations.
461461 """
462462 self .logger .debug ("Starting playwright initialization with timeout..." )
463-
463+
464464 try :
465465 # Use asyncio.wait_for to add a timeout to prevent hanging
466466 # If the environment doesn't allow blocking operations, this will fail fast
467467 playwright_instance = await asyncio .wait_for (
468- async_playwright ().start (),
469- timeout = 30.0 # 30 second timeout
468+ async_playwright ().start (), timeout = 30.0 # 30 second timeout
470469 )
471-
470+
472471 self .logger .debug ("Playwright initialized successfully" )
473472 return playwright_instance
474-
473+
475474 except asyncio .TimeoutError :
476475 self .logger .error ("Playwright initialization timed out" )
477476 raise RuntimeError (
You can’t perform that action at this time.
0 commit comments