Skip to content

Commit a08e44c

Browse files
author
José Valim
committed
Default max_restarts to 3 (closer to Erlang)
1 parent 08f3009 commit a08e44c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/elixir/lib/supervisor/spec.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ defmodule Supervisor.Spec do
145145
in the `Supervisor` module docs.
146146
147147
* `:max_restarts` - the maximum amount of restarts allowed in
148-
a time frame. Defaults to 5.
148+
a time frame. Defaults to 3.
149149
150150
* `:max_seconds` - the time frame in which `:max_restarts` applies.
151151
Defaults to 5.
152152
153-
The `:strategy` option is required and by default maximum 5 restarts
153+
The `:strategy` option is required and by default maximum 3 restarts
154154
are allowed within 5 seconds. Please check the `Supervisor` module for
155155
a complete description of the available strategies.
156156
"""
@@ -162,7 +162,7 @@ defmodule Supervisor.Spec do
162162
raise ArgumentError, "expected :strategy option to be given"
163163
end
164164

165-
maxR = Keyword.get(options, :max_restarts, 5)
165+
maxR = Keyword.get(options, :max_restarts, 3)
166166
maxS = Keyword.get(options, :max_seconds, 5)
167167

168168
assert_unique_ids(Enum.map(children, &elem(&1, 0)))

0 commit comments

Comments
 (0)