summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-07-03 11:18:42 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-12 01:23:55 -0400
commit971ed3daf11c51319b1bfa0eef73fbed2b2cc653 (patch)
tree591a43ca4477fe926bb84607611adf28e9805c0b
parentf3c820d21573a93bc8b792ef555a578d8db2f0b3 (diff)
cast to int, otherwise "1" > 2
-rw-r--r--src/mem3_util.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mem3_util.erl b/src/mem3_util.erl
index 7c31ce8e..aa43fd88 100644
--- a/src/mem3_util.erl
+++ b/src/mem3_util.erl
@@ -108,8 +108,10 @@ to_integer(N) when is_list(N) ->
list_to_integer(N).
n_val(undefined, NodeCount) ->
- n_val(list_to_integer(couch_config:get("cluster", "n", "3")), NodeCount);
-n_val(N, NodeCount) when N > NodeCount ->
+ n_val(couch_config:get("cluster", "n", "3"), NodeCount);
+n_val(N, NodeCount) when is_list(N) ->
+ n_val(list_to_integer(N), NodeCount);
+n_val(N, NodeCount) when is_integer(NodeCount), N > NodeCount ->
?LOG_ERROR("Request to create N=~p DB but only ~p node(s)", [N, NodeCount]),
NodeCount;
n_val(N, _) ->