You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2019/01/30 13:20:11 UTC

[couchdb-ioq] 05/17: Allow to customize concurrency value

This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch cloudant-ioq
in repository https://gitbox.apache.org/repos/asf/couchdb-ioq.git

commit c552c665dc6af0ca750ce074c816c4fcb0f05962
Author: Alexander Shorin <kx...@apache.org>
AuthorDate: Mon Sep 22 17:35:37 2014 +0400

    Allow to customize concurrency value
---
 src/ioq.erl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/ioq.erl b/src/ioq.erl
index 9bfb1f8..4598c37 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}.