Skip to content

Commit 3954314

Browse files
committed
Mention max_lifetime option in disconnect_all
1 parent 4af9f13 commit 3954314

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lib/ecto/adapters/sql.ex

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,8 @@ defmodule Ecto.Adapters.SQL do
478478
Forces all connections in the repo pool to disconnect within the given interval.
479479
480480
Once this function is called, the pool will disconnect all of its connections
481-
as they are checked in or as they are pinged. Checked in connections will be
482-
randomly disconnected within the given time interval. Pinged connections are
483-
immediately disconnected - as they are idle (according to `:idle_interval`).
481+
as they are checked in or as they are pinged. Checked in and idle connections
482+
will be randomly disconnected within the given time interval.
484483
485484
If the connection has a backoff configured (which is the case by default),
486485
disconnecting means an attempt at a new connection will be done immediately
@@ -489,6 +488,9 @@ defmodule Ecto.Adapters.SQL do
489488
disconnecting all connections may cause the pool supervisor to restart
490489
depending on the max_restarts/max_seconds configuration of the pool,
491490
so you will want to set those carefully.
491+
492+
If you need connections to be restarted periodically, set the `:max_lifetime`
493+
option in your repository configuration instead.
492494
"""
493495

494496
@doc @to_sql_doc

0 commit comments

Comments
 (0)