Link to Connection Pid

This commit is contained in:
terry-xiaoyu 2019-05-25 18:55:43 +08:00
parent 9a7b84fe62
commit f0023f1b55
1 changed files with 2 additions and 1 deletions

View File

@ -85,7 +85,8 @@ init([Pool, Id, Mod, Opts]) ->
process_flag(trap_exit, true), process_flag(trap_exit, true),
State = #state{pool = Pool, id = Id, mod = Mod, opts = Opts}, State = #state{pool = Pool, id = Id, mod = Mod, opts = Opts},
case connect(State) of case connect(State) of
{ok, Client} -> {ok, Client} when is_pid(Client) ->
erlang:link(Client),
gproc_pool:connect_worker(ecpool:name(Pool), {Pool, Id}), gproc_pool:connect_worker(ecpool:name(Pool), {Pool, Id}),
{ok, State#state{client = Client}}; {ok, State#state{client = Client}};
{error, Error} -> {error, Error} ->