Link to Connection Pid
This commit is contained in:
parent
9a7b84fe62
commit
f0023f1b55
|
@ -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} ->
|
||||||
|
|
Loading…
Reference in New Issue