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/25 23:24:22 UTC
couch commit: updated refs/heads/2938-fix-5986-filtered-changes to
7c7b14e [Forced Update!]
Repository: couchdb-couch
Updated Branches:
refs/heads/2938-fix-5986-filtered-changes 81ee4efcc -> 7c7b14ee1 (forced update)
Only use fetch/ddoc_cache for clustered calls
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/7c7b14ee
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/7c7b14ee
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/7c7b14ee
Branch: refs/heads/2938-fix-5986-filtered-changes
Commit: 7c7b14ee11023740c5e77f85d68dbda22d848913
Parents: 9383c5c
Author: Russell Branca <ch...@apache.org>
Authored: Thu Feb 25 19:47:13 2016 +0000
Committer: Russell Branca <ch...@apache.org>
Committed: Thu Feb 25 22:23:39 2016 +0000
----------------------------------------------------------------------
src/couch_changes.erl | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/7c7b14ee/src/couch_changes.erl
----------------------------------------------------------------------
diff --git a/src/couch_changes.erl b/src/couch_changes.erl
index 73a3cce..7d5cf6e 100644
--- a/src/couch_changes.erl
+++ b/src/couch_changes.erl
@@ -231,11 +231,15 @@ configure_filter(FilterName, Style, Req, Db) ->
FilterNameParts = string:tokens(FilterName, "/"),
case [?l2b(couch_httpd:unquote(Part)) || Part <- FilterNameParts] of
[DName, FName] ->
- DesignId = <<"_design/", DName/binary>>,
- {ok, DDoc} = ddoc_cache:open_doc(fabric:dbname(Db), DesignId),
+ {ok, DDoc} = open_ddoc(Db, <<"_design/", DName/binary>>),
check_member_exists(DDoc, [<<"filters">>, FName]),
- DIR = fabric_util:doc_id_and_rev(DDoc),
- {fetch, Style, Req, DIR, FName};
+ case Db#db.id_tree of
+ undefined ->
+ DIR = fabric_util:doc_id_and_rev(DDoc),
+ {fetch, Style, Req, DIR, FName};
+ _ ->
+ {custom, Style, Req, DDoc, FName}
+ end;
[] ->
{default, Style};
@@ -339,15 +343,7 @@ check_docids(_) ->
open_ddoc(#db{name=DbName, id_tree=undefined}, DDocId) ->
- {_, Ref} = spawn_monitor(fun() ->
- exit(fabric:open_doc(mem3:dbname(DbName), DDocId, [ejson_body]))
- end),
- receive
- {'DOWN', Ref, _, _, {ok, _}=Response} ->
- Response;
- {'DOWN', Ref, _, _, Response} ->
- throw(Response)
- end;
+ {ok, _DDoc} = ddoc_cache:open_doc(mem3:dbname(DbName), DDocId);
open_ddoc(Db, DDocId) ->
case couch_db:open_doc(Db, DDocId, [ejson_body]) of
{ok, _} = Resp -> Resp;