We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a22ce6 commit 9567271Copy full SHA for 9567271
mongo/client.go
@@ -281,6 +281,10 @@ func (c *Client) Disconnect(ctx context.Context) error {
281
ctx = context.Background()
282
}
283
284
+ if c.httpClient == internal.DefaultHTTPClient {
285
+ defer internal.CloseIdleHTTPConnections(c.httpClient)
286
+ }
287
+
288
c.endSessions(ctx)
289
if c.mongocryptdFLE != nil {
290
if err := c.mongocryptdFLE.disconnect(ctx); err != nil {
@@ -312,10 +316,6 @@ func (c *Client) Disconnect(ctx context.Context) error {
312
316
return replaceErrors(disconnector.Disconnect(ctx))
313
317
314
318
315
- if c.httpClient == internal.DefaultHTTPClient {
- internal.CloseIdleHTTPConnections(c.httpClient)
- }
-
319
return nil
320
321
0 commit comments