0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00

Don't ignore the return values in cowboy:stop_listener/1.

This commit is contained in:
Loïc Hoguin 2011-04-03 15:21:29 +02:00
parent cb079c8a34
commit a8af32c54b

View file

@ -27,7 +27,11 @@ start_listener(Ref, NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts) ->
]},
permanent, 5000, supervisor, [cowboy_listener_sup]}).
-spec stop_listener(Ref::term()) -> ok.
-spec stop_listener(Ref::term()) -> ok | {error, not_found}.
stop_listener(Ref) ->
supervisor:terminate_child(cowboy_sup, {cowboy_listener_sup, Ref}),
supervisor:delete_child(cowboy_sup, {cowboy_listener_sup, Ref}).
case supervisor:terminate_child(cowboy_sup, {cowboy_listener_sup, Ref}) of
ok ->
supervisor:delete_child(cowboy_sup, {cowboy_listener_sup, Ref});
{error, Reason} ->
{error, Reason}
end.