mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
Merge branch 'remove-queue-len-call' of https://github.com/puzza007/cowboy
This commit is contained in:
commit
2c0c85cd2f
1 changed files with 5 additions and 6 deletions
|
@ -202,11 +202,10 @@ remove_pid(Pid, Pools, ReqsTable, Queue) ->
|
|||
{Pool, NbConns} = lists:keyfind(Pool, 1, Pools),
|
||||
Pools2 = [{Pool, NbConns - 1}|lists:keydelete(Pool, 1, Pools)],
|
||||
ets:delete(ReqsTable, Pid),
|
||||
case queue:len(Queue) of
|
||||
0 ->
|
||||
{Pools2, Queue};
|
||||
_ ->
|
||||
{{value, Client}, Queue2} = queue:out(Queue),
|
||||
case queue:out(Queue) of
|
||||
{{value, Client}, Queue2} ->
|
||||
gen_server:reply(Client, ok),
|
||||
{Pools2, Queue2}
|
||||
{Pools2, Queue2};
|
||||
_ ->
|
||||
{Pools2, Queue}
|
||||
end.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue