aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_connection_sup.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-03-23 16:53:53 +0100
committerHans Nilsson <[email protected]>2017-04-07 10:23:35 +0200
commit8f4bb9b0bd3aed663521371726ea3ec460e231a0 (patch)
tree78957c1854efbe5c556a1f2ef99dcbc72a3ac81a /lib/ssh/src/ssh_connection_sup.erl
parent6158cb432092c47e178b4dc1177b46cb8c310ab4 (diff)
downloadotp-8f4bb9b0bd3aed663521371726ea3ec460e231a0.tar.gz
otp-8f4bb9b0bd3aed663521371726ea3ec460e231a0.tar.bz2
otp-8f4bb9b0bd3aed663521371726ea3ec460e231a0.zip
ssh: Mappify supervisors
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}}.