couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chewbra...@apache.org
Subject [3/3] couch commit: updated refs/heads/add-filter-revs-limit to 7c80907
Date Mon, 12 Oct 2015 21:59:06 GMT
Whitespace and housekeeping


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

Branch: refs/heads/add-filter-revs-limit
Commit: 7c80907778d29742d9f37dd9121d00694d466357
Parents: 9576e03
Author: Russell Branca <chewbranca@apache.org>
Authored: Mon Oct 12 19:26:30 2015 +0000
Committer: Russell Branca <chewbranca@apache.org>
Committed: Mon Oct 12 21:58:25 2015 +0000

----------------------------------------------------------------------
 src/couch_query_servers.erl | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/7c809077/src/couch_query_servers.erl
----------------------------------------------------------------------
diff --git a/src/couch_query_servers.erl b/src/couch_query_servers.erl
index 604e188..c30a871 100644
--- a/src/couch_query_servers.erl
+++ b/src/couch_query_servers.erl
@@ -268,14 +268,13 @@ get_number(Key, Props) ->
 validate_doc_update(DDoc, EditDoc, DiskDoc, Ctx, SecObj) ->
     JsonEditDoc = couch_doc:to_json_obj(EditDoc, [revs]),
     JsonDiskDoc = json_doc(DiskDoc),
-    Resp = ddoc_prompt(DDoc,
-                       [<<"validate_doc_update">>],
-                       [JsonEditDoc, JsonDiskDoc, Ctx, SecObj]),
-    case Resp of
-        _ when Resp /= 1 ->
-            couch_stats:increment_counter(
-                [couchdb, query_server, vdu_rejects], 1);
-        _ -> ok
+    Resp = ddoc_prompt(
+        DDoc,
+        [<<"validate_doc_update">>],
+        [JsonEditDoc, JsonDiskDoc, Ctx, SecObj]
+    ),
+    if Resp == 1 -> ok; true ->
+        couch_stats:increment_counter([couchdb, query_server, vdu_rejects], 1)
     end,
     case Resp of
         1 ->
@@ -311,10 +310,10 @@ filter_view(DDoc, VName, Docs) ->
 
 filter_docs(Req, Db, DDoc, FName, Docs) ->
     JsonReq = case Req of
-    {json_req, JsonObj} ->
-        JsonObj;
-    #httpd{} = HttpReq ->
-        couch_httpd_external:json_req_obj(HttpReq, Db)
+        {json_req, JsonObj} ->
+            JsonObj;
+        #httpd{} = HttpReq ->
+            couch_httpd_external:json_req_obj(HttpReq, Db)
     end,
     Options = json_doc_options(),
     JsonDocs = [json_doc(Doc, Options) || Doc <- Docs],


Mime
View raw message