diff options
| author | Tim Watson <tim@rabbitmq.com> | 2012-12-05 12:07:08 +0000 |
|---|---|---|
| committer | Tim Watson <tim@rabbitmq.com> | 2012-12-05 12:07:08 +0000 |
| commit | 66272487d4e137c63189e54c82783b802583cf0f (patch) | |
| tree | 18bd5ff7b49362266658facf609338fcba0c0bce /src | |
| parent | bad1ed887a1b96c7efec723b07991f9b7254500c (diff) | |
| download | rabbitmq-server-git-66272487d4e137c63189e54c82783b802583cf0f.tar.gz | |
reduce distance to OTP - {temporary, Delay} is not a valid restart type
Diffstat (limited to 'src')
| -rw-r--r-- | src/supervisor2.erl | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/supervisor2.erl b/src/supervisor2.erl index d4d9e10693..e7e1367277 100644 --- a/src/supervisor2.erl +++ b/src/supervisor2.erl @@ -393,12 +393,8 @@ init_dynamic(_State, StartSpec) -> start_children(Children, SupName) -> start_children(Children, [], SupName). start_children([Child|Chs], NChildren, SupName) -> - Restart = case Child#child.restart_type of - A when is_atom(A) -> A; - {N, _} when is_atom(N) -> N - end, case do_start_child(SupName, Child) of - {ok, undefined} when Restart =:= temporary -> + {ok, undefined} when Child#child.restart_type =:= temporary -> start_children(Chs, NChildren, SupName); {ok, Pid} -> start_children(Chs, [Child#child{pid = Pid}|NChildren], SupName); @@ -453,13 +449,9 @@ do_start_child_i(M, F, A) -> handle_call({start_child, EArgs}, _From, State) when ?is_simple(State) -> Child = hd(State#state.children), #child{mfargs = {M, F, A}} = Child, - Restart = case Child#child.restart_type of - Name when is_atom(Name) -> Name; - {Type, _} when is_atom(Type) -> Type - end, Args = A ++ EArgs, case do_start_child_i(M, F, Args) of - {ok, undefined} when Restart =:= temporary -> + {ok, undefined} when Child#child.restart_type =:= temporary -> {reply, {ok, undefined}, State}; {ok, Pid} -> NState = save_dynamic_child(Child#child.restart_type, Pid, Args, State), |
