diff options
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. %% |
