couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [01/36] couch commit: updated refs/heads/windsor-merge-211 to b7adb86
Date Tue, 05 Aug 2014 21:17:44 GMT
Repository: couchdb-couch
Updated Branches:
  refs/heads/windsor-merge-211 [created] b7adb8690


Reset to default if max_dbs_open is deleted

max_dbs_opens is present in the stock default.ini so it appears we've
never deleted the value so far, just changed it up or down (mostly up
;))

When this property is deleted, reset to the default value.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/1caf4b68
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/1caf4b68
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/1caf4b68

Branch: refs/heads/windsor-merge-211
Commit: 1caf4b68bd3457a8593b294cf7dd24111a916c43
Parents: c68dc65
Author: Robert Newson <robert.newson@cloudant.com>
Authored: Mon Apr 15 21:46:22 2013 +0100
Committer: Robert Newson <rnewson@apache.org>
Committed: Mon Aug 4 14:16:54 2014 +0100

----------------------------------------------------------------------
 src/couch_server.erl | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/1caf4b68/src/couch_server.erl
----------------------------------------------------------------------
diff --git a/src/couch_server.erl b/src/couch_server.erl
index ef7a6b6..e54efcc 100644
--- a/src/couch_server.erl
+++ b/src/couch_server.erl
@@ -26,10 +26,12 @@
 
 -include_lib("couch/include/couch_db.hrl").
 
+-define(MAX_DBS_OPEN, 100).
+
 -record(server,{
     root_dir = [],
     dbname_regexp,
-    max_dbs_open=100,
+    max_dbs_open=?MAX_DBS_OPEN,
     dbs_open=0,
     start_time="",
     lru = couch_lru:new()
@@ -187,7 +189,7 @@ init([]) ->
 
     RootDir = config:get("couchdb", "database_dir", "."),
     MaxDbsOpen = list_to_integer(
-            config:get("couchdb", "max_dbs_open")),
+            config:get("couchdb", "max_dbs_open", integer_to_list(?MAX_DBS_OPEN))),
     ok = config:listen_for_changes(?MODULE, nil),
     ok = couch_file:init_delete_dir(RootDir),
     hash_admin_passwords(),
@@ -210,8 +212,10 @@ terminate(_Reason, _Srv) ->
 handle_config_change("couchdb", "database_dir", _, _, _) ->
     exit(whereis(couch_server), config_change),
     remove_handler;
-handle_config_change("couchdb", "max_dbs_open", Max, _, _) ->
+handle_config_change("couchdb", "max_dbs_open", Max, _, _) when is_list(Max) ->
     {ok, gen_server:call(couch_server,{set_max_dbs_open,list_to_integer(Max)})};
+handle_config_change("couchdb", "max_dbs_open", _, _, _) ->
+    {ok, gen_server:call(couch_server,{set_max_dbs_open,?MAX_DBS_OPEN})};
 handle_config_change("admins", _, _, Persist, _) ->
     % spawn here so couch event manager doesn't deadlock
     {ok, spawn(fun() -> hash_admin_passwords(Persist) end)};


Mime
View raw message