Skip to content

Commit

Permalink
Change racks number to 20
Browse files Browse the repository at this point in the history
  • Loading branch information
kkiselev committed Jun 12, 2013
1 parent 5860e0a commit bce5c97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/rack.erl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ start_rack(Path) ->
end,
case erlang:whereis(sup_id(Path)) of
undefined ->
start_rack(Path, [{workers, 10}]);
start_rack(Path, [{workers, 20}]);
Pid ->
{ok, Pid}
end.
Expand Down
6 changes: 3 additions & 3 deletions src/rack_manager.erl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ init([Options]) ->
{ok, #queue{
path = Path,
requests = queue:new(),
max_len = proplists:get_value(backlog, Options, 2000),
max_len = proplists:get_value(backlog, Options, 20),
working = []
}}.

Expand All @@ -39,7 +39,7 @@ remove_pid(Pid, #queue{requests = Requests} = State) ->
end, Requests),
case queue:len(Requests) of
0 -> ok;
_ -> ?D({remove_job,queue:len(Requests),queue:len(Req1)})
_ -> ok %?D({remove_job,queue:len(Requests),queue:len(Req1)})
end,
State#queue{requests = Req1}.

Expand All @@ -54,7 +54,7 @@ handle_call({request, _H, _B} = Request, From, #queue{requests = Requests, path
{Client, _} = From,
erlang:monitor(process, Client),
case queue:len(Requests) of
Len when Len > 20 -> ?D({queue, queue:len(Requests) + 1});
Len when Len > 20 -> ok; %?D({queue, queue:len(Requests) + 1});
_ -> ok
end,
{noreply, State#queue{requests = queue:in({Request,From}, Requests)}}
Expand Down

0 comments on commit bce5c97

Please sign in to comment.