mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Don't ignore the return values in cowboy:stop_listener/1.
This commit is contained in:
parent
cb079c8a34
commit
a8af32c54b
1 changed files with 7 additions and 3 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue