You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/02/05 00:06:51 UTC

[38/50] couch commit: updated refs/heads/import to c3116d7

Add a config:reload/0 and HTTP trigger

Theoretically this should prevent all of those annoying test suite
failures when a test fails in with a temporary config set and fails to
undo its changes.

This works by storing the list of INI files in the config server and on
command will clear its ets table and re-read data from disk thus
clearing its cache of non-persisted values. Obviously this isn't
something that should be relied on in production settings.


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

Branch: refs/heads/import
Commit: 1a8d72c53184be4c3994ed16891a25f27e681466
Parents: cadc7e6
Author: Paul J. Davis <pa...@gmail.com>
Authored: Wed Mar 13 01:47:34 2013 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Feb 4 17:03:25 2014 -0600

----------------------------------------------------------------------
 src/couch_httpd_misc_handlers.erl | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/1a8d72c5/src/couch_httpd_misc_handlers.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_misc_handlers.erl b/src/couch_httpd_misc_handlers.erl
index b8f59cd..d57ceeb 100644
--- a/src/couch_httpd_misc_handlers.erl
+++ b/src/couch_httpd_misc_handlers.erl
@@ -157,6 +157,11 @@ handle_config_req(#httpd{method='GET', path_parts=[_, Section, Key]}=Req) ->
     Value ->
         send_json(Req, 200, list_to_binary(Value))
     end;
+% POST /_config/_reload - Flushes unpersisted config values from RAM
+handle_config_req(#httpd{method='POST', path_parts=[_, <<"_reload">>]}=Req) ->
+    ok = couch_httpd:verify_is_server_admin(Req),
+    ok = config:reload(),
+    send_json(Req, 200, {[{ok, true}]});
 % PUT or DELETE /_config/Section/Key
 handle_config_req(#httpd{method=Method, path_parts=[_, Section, Key]}=Req)
       when (Method == 'PUT') or (Method == 'DELETE') ->
@@ -215,7 +220,7 @@ handle_config_req(#httpd{method=Method, path_parts=[_, Section, Key]}=Req)
             end
     end;
 handle_config_req(Req) ->
-    send_method_not_allowed(Req, "GET,PUT,DELETE").
+    send_method_not_allowed(Req, "GET,PUT,POST,DELETE").
 
 % PUT /_config/Section/Key
 % "value"