Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 26FC01772D for ; Tue, 3 Feb 2015 15:13:09 +0000 (UTC) Received: (qmail 89096 invoked by uid 500); 3 Feb 2015 15:13:09 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 88940 invoked by uid 500); 3 Feb 2015 15:13:09 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 88713 invoked by uid 99); 3 Feb 2015 15:13:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2015 15:13:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1B188E03F2; Tue, 3 Feb 2015 15:13:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: robertkowalski@apache.org To: commits@couchdb.apache.org Date: Tue, 03 Feb 2015 15:13:14 -0000 Message-Id: <6230d38f84954e59a1243b7350b95c28@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [07/50] [abbrv] couchdb-mango git commit: Remove hardcoded w=3 for design doc updates Remove hardcoded w=3 for design doc updates This was left over from testing. Probably best to remove it for production. Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/116227c5 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/116227c5 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/116227c5 Branch: refs/heads/master Commit: 116227c5b3a41fd38e3642312c02bc8840921403 Parents: bbac0d2 Author: Paul J. Davis Authored: Tue Jun 24 15:30:33 2014 -0500 Committer: Paul J. Davis Committed: Tue Jun 24 15:30:33 2014 -0500 ---------------------------------------------------------------------- src/mango_httpd.erl | 4 ++-- src/mango_opts.erl | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/116227c5/src/mango_httpd.erl ---------------------------------------------------------------------- diff --git a/src/mango_httpd.erl b/src/mango_httpd.erl index 36ebd91..68bced0 100644 --- a/src/mango_httpd.erl +++ b/src/mango_httpd.erl @@ -49,7 +49,7 @@ handle_index_req(#httpd{method='POST', path_parts=[_, _]}=Req, Db) -> {ok, DDoc} -> <<"exists">>; {ok, NewDDoc} -> - case mango_crud:insert(Db, NewDDoc, [{w, "3"} | Opts]) of + case mango_crud:insert(Db, NewDDoc, Opts) of {ok, [{RespProps}]} -> case lists:keyfind(error, 1, RespProps) of {error, Reason} -> @@ -91,7 +91,7 @@ handle_index_req(#httpd{method='DELETE', _ -> NewDDoc end, - case mango_crud:insert(Db, FinalDDoc, [{w, "3"}]) of + case mango_crud:insert(Db, FinalDDoc, []) of {ok, _} -> chttpd:send_json(Req, {[{ok, true}]}); _ -> http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/116227c5/src/mango_opts.erl ---------------------------------------------------------------------- diff --git a/src/mango_opts.erl b/src/mango_opts.erl index 44426db..9affbd0 100644 --- a/src/mango_opts.erl +++ b/src/mango_opts.erl @@ -46,6 +46,12 @@ validate_idx_create({Props}) -> {optional, true}, {default, auto_name}, {validator, fun validate_idx_name/1} + ]}, + {<<"w">>, [ + {tag, w}, + {optional, true}, + {default, 2}, + {validator, fun is_non_neg_integer/1} ]} ], validate(Props, Opts).