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 | 9d43c1ef36cae496223e5058afc927ebdf800ab4 (patch) | |
tree | 18bd5ff7b49362266658facf609338fcba0c0bce | |
parent | 9803385de90f12f5d1dbdc1a6f716927d977b066 (diff) | |
download | rabbitmq-server-9d43c1ef36cae496223e5058afc927ebdf800ab4.tar.gz |
reduce distance to OTP - {temporary, Delay} is not a valid restart type
-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 d4d9e106..e7e13672 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), |