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:
240
240
"https://dochub.mongodb.org/core/pymongo-fork-deadlock" ,
241
241
** kwargs ,
242
242
)
243
- close_servers = []
244
243
async with self ._lock :
245
244
# Close servers and clear the pools.
246
245
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 ()
250
247
# Reset the session pool to avoid duplicate sessions in
251
248
# the child process.
252
249
self ._session_pool .reset ()
253
250
254
- for server in close_servers :
255
- await server .close ()
256
-
257
251
async with self ._lock :
258
252
await self ._ensure_opened ()
259
253
Original file line number Diff line number Diff line change @@ -240,20 +240,14 @@ def open(self) -> None:
240
240
"https://dochub.mongodb.org/core/pymongo-fork-deadlock" ,
241
241
** kwargs ,
242
242
)
243
- close_servers = []
244
243
with self ._lock :
245
244
# Close servers and clear the pools.
246
245
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 ()
250
247
# Reset the session pool to avoid duplicate sessions in
251
248
# the child process.
252
249
self ._session_pool .reset ()
253
250
254
- for server in close_servers :
255
- server .close ()
256
-
257
251
with self ._lock :
258
252
self ._ensure_opened ()
259
253
You can’t perform that action at this time.
0 commit comments