File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -85,18 +85,22 @@ async def connect_and_provide_credentials(
8585 # Give connection time to start and open the browser
8686 await asyncio .sleep (5 )
8787
88- # Run browser automation in a thread
88+ # Run browser automation in a thread WITHOUT blocking the event loop
89+ # This allows the connection task to continue making progress
8990 loop = asyncio .get_running_loop ()
90- await loop .run_in_executor (
91+ credentials_task = loop .run_in_executor (
9192 None ,
9293 self ._provide_credentials ,
9394 scenario ,
9495 login ,
9596 password ,
9697 )
9798
98- # Wait for connection to complete
99- await connect_task
99+ # Wait for both tasks to complete concurrently
100+ await asyncio .gather (connect_task , credentials_task )
101+ else :
102+ # Wait for connection to complete
103+ await connect_task
100104
101105 # except Exception as e:
102106 # self.error_msg = e
You can’t perform that action at this time.
0 commit comments