aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_connection_sup.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-04-07 15:16:56 +0200
committerHans Nilsson <[email protected]>2017-04-07 15:16:56 +0200
commit3a29920a05cedee8c1f7501ee7b1aa22e068efed (patch)
treeb9d7c89af83a12dbccc010e67c1f2472a1a8f8bf /lib/ssh/src/ssh_connection_sup.erl
parent90aacace4bdb1c883c3829bc66c1c616a81943d9 (diff)
parentb89f06569ee24011a8535c57d6a82e336afeb5bf (diff)
downloadotp-3a29920a05cedee8c1f7501ee7b1aa22e068efed.tar.gz
otp-3a29920a05cedee8c1f7501ee7b1aa22e068efed.tar.bz2
otp-3a29920a05cedee8c1f7501ee7b1aa22e068efed.zip
Merge branch 'hans/ssh/supervisors/OTP-14267'
Diffstat (limited to 'lib/ssh/src/ssh_connection_sup.erl')
-rw-r--r--lib/ssh/src/ssh_connection_sup.erl28
1 files changed, 13 insertions, 15 deletions
diff --git a/lib/ssh/src/ssh_connection_sup.erl b/lib/ssh/src/ssh_connection_sup.erl
index 0f54053f52..fad796f196 100644
--- a/lib/ssh/src/ssh_connection_sup.erl
+++ b/lib/ssh/src/ssh_connection_sup.erl
@@ -45,19 +45,17 @@ start_child(Sup, Args) ->
%%%=========================================================================
%%% Supervisor callback
%%%=========================================================================
--spec init( [term()] ) -> {ok,{supervisor:sup_flags(),[supervisor:child_spec()]}} | ignore .
-
init(_) ->
- RestartStrategy = simple_one_for_one,
- MaxR = 0,
- MaxT = 3600,
-
- Name = undefined, % As simple_one_for_one is used.
- StartFunc = {ssh_connection_handler, start_link, []},
- Restart = temporary, % E.g. should not be restarted
- Shutdown = 4000,
- Modules = [ssh_connection_handler],
- Type = worker,
-
- ChildSpec = {Name, StartFunc, Restart, Shutdown, Type, Modules},
- {ok, {{RestartStrategy, MaxR, MaxT}, [ChildSpec]}}.
+ SupFlags = #{strategy => simple_one_for_one,
+ intensity => 0,
+ period => 3600
+ },
+ ChildSpecs = [#{id => undefined, % As simple_one_for_one is used.
+ start => {ssh_connection_handler, start_link, []},
+ restart => temporary,
+ shutdown => 4000,
+ type => worker,
+ modules => [ssh_connection_handler]
+ }
+ ],
+ {ok, {SupFlags,ChildSpecs}}.