Skip to content

Commit 597477c

Browse files
authored
Documentation formatting fix (#993)
* Note that the reconnect pattern is only applicable to driver 2.7.0+ * Fix docs
1 parent bb169d2 commit 597477c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/tutorials/ruby-driver-create-client.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ This is because:
587587
It is easiest to not create any Mongo::Client instances prior to the fork.
588588
If the parent process needs to perform operations on the MongoDB database,
589589
reset the client in an ``after_fork`` handler which is defined in
590-
``unicorn.rb``::
590+
``unicorn.rb``:
591591

592592
.. code-block:: ruby
593593

@@ -601,7 +601,7 @@ global variable. It also keeps the MongoDB connection in the parent process
601601
around, and this connection will continue to consume resources such as
602602
a connection slot. If the parent process performs one time operation(s) on
603603
MongoDB and does not need its MongoDB connection once workers are forked,
604-
the following code will close the connection in the parent::
604+
the following code will close the connection in the parent:
605605

606606
.. code-block:: ruby
607607

@@ -613,6 +613,8 @@ the following code will close the connection in the parent::
613613
$client.reconnect
614614
end
615615

616+
*Note:* This pattern should be used with Ruby driver version 2.7.0 or higher.
617+
Previous driver versions did not recreate monitoring threads when reconnecting.
616618

617619
Details on Retryable Writes
618620
---------------------------

0 commit comments

Comments
 (0)