Skip to content

Commit

Permalink
fix: don't restart the crashed worker process if auto_reconnect=false
Browse files Browse the repository at this point in the history
  • Loading branch information
HJianBo committed Jul 17, 2023
1 parent 418af49 commit f5f8144
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/ecpool.appup.src
@@ -1,6 +1,9 @@
%% -*-: erlang -*-
{"0.5.4",
{"0.5.5",
[
{"0.5.4", [
{load_module, ecpool_worker, brutal_purge, soft_purge, []}
]},
{"0.5.3", [
{load_module, ecpool_worker, brutal_purge, soft_purge, []},
{load_module, ecpool, brutal_purge, soft_purge, []}
Expand All @@ -20,6 +23,9 @@
]}
],
[
{"0.5.4", [
{load_module, ecpool_worker, brutal_purge, soft_purge, []}
]},
{"0.5.3", [
{load_module, ecpool_worker, brutal_purge, soft_purge, []},
{load_module, ecpool, brutal_purge, soft_purge, []}
Expand Down
2 changes: 1 addition & 1 deletion src/ecpool_worker.erl
Expand Up @@ -176,7 +176,7 @@ handle_info({'EXIT', Pid, Reason}, State = #state{opts = Opts, supervisees = Sup
case lists:member(Pid, SupPids) of
true ->
case proplists:get_value(auto_reconnect, Opts, false) of
false -> {stop, Reason, erase_client(Pid, State)};
false -> {stop, {shutdown, Reason}, erase_client(Pid, State)};
Secs -> reconnect(Secs, erase_client(Pid, State))
end;
false ->
Expand Down

0 comments on commit f5f8144

Please sign in to comment.