summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Shorin <kxepal@apache.org>2014-09-22 17:35:37 +0400
committerAlexander Shorin <kxepal@apache.org>2014-10-13 21:21:03 +0400
commitc552c665dc6af0ca750ce074c816c4fcb0f05962 (patch)
tree1665faa50aa71ac2003beba28ff138e54a8f9f0a
parent40d157f39c0fa0d80db9ccf61b770b72103ddbed (diff)
downloadcouchdb-c552c665dc6af0ca750ce074c816c4fcb0f05962.tar.gz
Allow to customize concurrency value
-rw-r--r--src/ioq.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ioq.erl b/src/ioq.erl
index 9bfb1f8e3..4598c3766 100644
--- a/src/ioq.erl
+++ b/src/ioq.erl
@@ -21,7 +21,7 @@
-export([handle_config_change/5]).
-record(state, {
- concurrency=10,
+ concurrency,
ratio,
interactive=queue:new(),
compaction=queue:new(),
@@ -55,7 +55,8 @@ init(_) ->
read_config(State) ->
Ratio = list_to_float(config:get("ioq", "ratio", "0.01")),
- State#state{ratio=Ratio}.
+ Concurrency = list_to_integer(config:get("ioq", "concurrency", "10")),
+ State#state{concurrency=Concurrency, ratio=Ratio}.
handle_call(#request{}=Request, From, State) ->
{noreply, enqueue_request(Request#request{from=From}, State), 0}.