File tree Expand file tree Collapse file tree 2 files changed +2
-14
lines changed
Expand file tree Collapse file tree 2 files changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -240,20 +240,14 @@ async def open(self) -> None:
240240 "https://dochub.mongodb.org/core/pymongo-fork-deadlock" ,
241241 ** kwargs ,
242242 )
243- close_servers = []
244243 async with self ._lock :
245244 # Close servers and clear the pools.
246245 for server in self ._servers .values ():
247- close_servers .append (server )
248- if not _IS_SYNC :
249- self ._monitor_tasks .append (server ._monitor )
246+ await server .close ()
250247 # Reset the session pool to avoid duplicate sessions in
251248 # the child process.
252249 self ._session_pool .reset ()
253250
254- for server in close_servers :
255- await server .close ()
256-
257251 async with self ._lock :
258252 await self ._ensure_opened ()
259253
Original file line number Diff line number Diff line change @@ -240,20 +240,14 @@ def open(self) -> None:
240240 "https://dochub.mongodb.org/core/pymongo-fork-deadlock" ,
241241 ** kwargs ,
242242 )
243- close_servers = []
244243 with self ._lock :
245244 # Close servers and clear the pools.
246245 for server in self ._servers .values ():
247- close_servers .append (server )
248- if not _IS_SYNC :
249- self ._monitor_tasks .append (server ._monitor )
246+ server .close ()
250247 # Reset the session pool to avoid duplicate sessions in
251248 # the child process.
252249 self ._session_pool .reset ()
253250
254- for server in close_servers :
255- server .close ()
256-
257251 with self ._lock :
258252 self ._ensure_opened ()
259253
You can’t perform that action at this time.
0 commit comments