Add missing demonitor() calls

This commit is contained in:
Ulf Wiger 2025-08-20 20:43:17 +02:00
parent 5bc0fc5ff8
commit 36a11575d2

View File

@ -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.