diff options
author | Hans Nilsson <[email protected]> | 2017-03-23 16:53:53 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2017-04-07 10:23:35 +0200 |
commit | 8f4bb9b0bd3aed663521371726ea3ec460e231a0 (patch) | |
tree | 78957c1854efbe5c556a1f2ef99dcbc72a3ac81a /lib/ssh/src/ssh_sup.erl | |
parent | 6158cb432092c47e178b4dc1177b46cb8c310ab4 (diff) | |
download | otp-8f4bb9b0bd3aed663521371726ea3ec460e231a0.tar.gz otp-8f4bb9b0bd3aed663521371726ea3ec460e231a0.tar.bz2 otp-8f4bb9b0bd3aed663521371726ea3ec460e231a0.zip |
ssh: Mappify supervisors
Diffstat (limited to 'lib/ssh/src/ssh_sup.erl')
-rw-r--r-- | lib/ssh/src/ssh_sup.erl | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/ssh/src/ssh_sup.erl b/lib/ssh/src/ssh_sup.erl index 5463401dcd..6be809b1bd 100644 --- a/lib/ssh/src/ssh_sup.erl +++ b/lib/ssh/src/ssh_sup.erl @@ -32,19 +32,19 @@ %%% Supervisor callback %%%========================================================================= init(_) -> - SupFlags = {one_for_one, 10, 3600}, - Children = [child_spec(sshd_sup), child_spec(sshc_sup)], %%children(), - {ok, {SupFlags, Children}}. - -%%%========================================================================= -%%% Internal functions -%%%========================================================================= -child_spec(Name) -> - StartFunc = {Name, start_link, []}, - Restart = permanent, - Shutdown = infinity, - Modules = [Name], - Type = supervisor, - {Name, StartFunc, Restart, Shutdown, Type, Modules}. - + SupFlags = #{strategy => one_for_one, + intensity => 10, + period => 3600 + }, + ChildSpecs = [#{id => Module, + start => {Module, start_link, []}, + restart => permanent, + shutdown => brutal_kill, + type => supervisor, + modules => [Module] + } + || Module <- [sshd_sup, + sshc_sup] + ], + {ok, {SupFlags,ChildSpecs}}. |