You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2016/02/10 23:30:21 UTC
[2/2] couch commit: updated
refs/heads/2938-use-ddoc-cache-in-filtered-changes to fabc25f
Use ddoc_cache and new fetch rpc format
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/fabc25f3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/fabc25f3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/fabc25f3
Branch: refs/heads/2938-use-ddoc-cache-in-filtered-changes
Commit: fabc25f351e2a30d2f7d8ba2131595707b156e22
Parents: 010704a
Author: Russell Branca <ch...@apache.org>
Authored: Thu Jan 21 22:57:18 2016 +0000
Committer: Russell Branca <ch...@apache.org>
Committed: Wed Feb 10 22:20:44 2016 +0000
----------------------------------------------------------------------
src/couch_changes.erl | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/fabc25f3/src/couch_changes.erl
----------------------------------------------------------------------
diff --git a/src/couch_changes.erl b/src/couch_changes.erl
index 7547aef..0d418e8 100644
--- a/src/couch_changes.erl
+++ b/src/couch_changes.erl
@@ -229,9 +229,12 @@ configure_filter(FilterName, Style, Req, Db) ->
FilterNameParts = string:tokens(FilterName, "/"),
case [?l2b(couch_httpd:unquote(Part)) || Part <- FilterNameParts] of
[DName, FName] ->
- {ok, DDoc} = open_ddoc(Db, <<"_design/", DName/binary>>),
+ DesignId = <<"_design/", DName/binary>>,
+ {ok, DDoc} = ddoc_cache:open_doc(fabric:dbname(Db), DesignId),
check_member_exists(DDoc, [<<"filters">>, FName]),
- {custom, Style, Req, DDoc, FName};
+ DIR = fabric_util:doc_id_and_rev(DDoc),
+ {fetch, Style, Req, DIR, FName};
+
[] ->
{default, Style};
_Else ->