mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 12:40: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),
|
{Pool, NbConns} = lists:keyfind(Pool, 1, Pools),
|
||||||
Pools2 = [{Pool, NbConns - 1}|lists:keydelete(Pool, 1, Pools)],
|
Pools2 = [{Pool, NbConns - 1}|lists:keydelete(Pool, 1, Pools)],
|
||||||
ets:delete(ReqsTable, Pid),
|
ets:delete(ReqsTable, Pid),
|
||||||
case queue:len(Queue) of
|
case queue:out(Queue) of
|
||||||
0 ->
|
{{value, Client}, Queue2} ->
|
||||||
{Pools2, Queue};
|
|
||||||
_ ->
|
|
||||||
{{value, Client}, Queue2} = queue:out(Queue),
|
|
||||||
gen_server:reply(Client, ok),
|
gen_server:reply(Client, ok),
|
||||||
{Pools2, Queue2}
|
{Pools2, Queue2};
|
||||||
|
_ ->
|
||||||
|
{Pools2, Queue}
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue