Add missing demonitor() calls #11
@ -129,12 +129,15 @@ call_connector(Req0) ->
|
|||||||
gmhc_connector:send(ViaId, #{call => Req#{ id => Id }}),
|
gmhc_connector:send(ViaId, #{call => Req#{ id => Id }}),
|
||||||
receive
|
receive
|
||||||
{from_pool, #{reply := #{ id := Id, result := Result }}} ->
|
{from_pool, #{reply := #{ id := Id, result := Result }}} ->
|
||||||
|
erlang:demonitor(MRef),
|
||||||
Result;
|
Result;
|
||||||
{from_pool, #{error := #{ id := Id } = Error}} ->
|
{from_pool, #{error := #{ id := Id } = Error}} ->
|
||||||
|
erlang:demonitor(MRef),
|
||||||
{error, maps:remove(id, Error)};
|
{error, maps:remove(id, Error)};
|
||||||
{'DOWN', MRef, _, _, _} ->
|
{'DOWN', MRef, _, _, _} ->
|
||||||
{error, no_connection}
|
{error, no_connection}
|
||||||
after 5000 ->
|
after 5000 ->
|
||||||
|
erlang:demonitor(MRef),
|
||||||
{error, {timeout, process_info(self(), messages)}}
|
{error, {timeout, process_info(self(), messages)}}
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user