Use the design doc cache for design requests

This will use cached design docs for all of the various design handlers
like views, shows, lists, and rewrites.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/087e99c4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/087e99c4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/087e99c4

Branch: refs/heads/import
Commit: 087e99c4f2aca4ba79ea443a970c3d53309fb834
Parents: 52b3bc5
Author: Paul J. Davis <[email protected]>
Authored: Wed Jan 23 15:51:47 2013 -0600
Committer: Robert Newson <[email protected]>
Committed: Wed Mar 6 12:22:38 2013 -0600

----------------------------------------------------------------------
 src/chttpd_db.erl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/087e99c4/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index a4a9e30..2aee9a9 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -146,7 +146,8 @@ handle_design_req(#httpd{
         path_parts=[_DbName, _Design, Name, <<"_",_/binary>> = Action | _Rest],
         design_url_handlers = DesignUrlHandlers
     }=Req, Db) ->
-    case fabric:open_doc(Db, <<"_design/", Name/binary>>, []) of
+    DbName = mem3:dbname(Db#db.name),
+    case ddoc_cache:open(DbName, <<"_design/", Name/binary>>) of
     {ok, DDoc} ->
         Handler = couch_util:get_value(Action, DesignUrlHandlers,
             fun bad_action_req/3),

Reply via email to