diff options
| author | Tim Watson <tim@rabbitmq.com> | 2013-02-01 14:02:49 +0000 |
|---|---|---|
| committer | Tim Watson <tim@rabbitmq.com> | 2013-02-01 14:02:49 +0000 |
| commit | 3d30fad7656b6a7bd2576ed7b87a9116f63f2816 (patch) | |
| tree | 0c8761ae1cd41f87569be2991a16cfd2875b4570 /src | |
| parent | e88fa5a99ea20cf779889cb3f432a2a885e241bc (diff) | |
| download | rabbitmq-server-git-3d30fad7656b6a7bd2576ed7b87a9116f63f2816.tar.gz | |
avoid badmatch in handle_info/delayed_restart
Diffstat (limited to 'src')
| -rw-r--r-- | src/supervisor2.erl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/supervisor2.erl b/src/supervisor2.erl index 7f04536a30..693e0b6df9 100644 --- a/src/supervisor2.erl +++ b/src/supervisor2.erl @@ -682,13 +682,11 @@ handle_info({'EXIT', Pid, Reason}, State) -> handle_info({delayed_restart, {RestartType, Reason, Child}}, State) when ?is_simple(State) -> - {ok, NState} = do_restart(RestartType, Reason, Child, State), - {noreply, NState}; + delayed_restart(RestartType, Reason, Child, State); handle_info({delayed_restart, {RestartType, Reason, Child}}, State) -> case get_child(Child#child.name, State) of {value, Child1} -> - {ok, NState} = do_restart(RestartType, Reason, Child1, State), - {noreply, NState}; + delayed_restart(RestartType, Reason, Child1, State); _What -> {noreply, State} end; @@ -698,6 +696,12 @@ handle_info(Msg, State) -> [Msg]), {noreply, State}. +delayed_restart(RestartType, Reason, Child, State) -> + case do_restart(RestartType, Reason, Child, State) of + {ok, NState} -> {noreply, NState}; + {try_again, _, NState} -> {noreply, NState} + end. + %% %% Terminate this server. %% |
