Skip to content

Commit

Permalink
WHISTLE-42: support bigcouch latency/zones
Browse files Browse the repository at this point in the history
  • Loading branch information
k-anderson committed Jun 15, 2012
1 parent 63665b0 commit 8213e3f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/couchbeam-0.8.0/src/couchbeam.erl
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ create_db(Server, DbName, Options) ->
create_db(#server{options=IbrowseOpts}=Server, DbName, Options, Params) ->
Options1 = couchbeam_util:propmerge1(Options, IbrowseOpts),
Url = make_url(Server, dbname(DbName), Params),
case couchbeam_httpc:request(put, Url, ["201"], Options1) of
case couchbeam_httpc:request(put, Url, ["201", "202"], Options1) of
{ok, _Status, _Headers, _Body} ->
{ok, #db{server=Server, name=DbName, options=Options1}};
{error, {ok, "412", _, _}} ->
Expand Down Expand Up @@ -477,7 +477,7 @@ save_docs(#db{server=Server, options=IbrowseOpts}=Db, Docs, Options) ->
end,
Url = make_url(Server, [db_url(Db), "/", "_bulk_docs"], Options2),
Headers = [{"Content-Type", "application/json"}],
case db_request(post, Url, ["201"], IbrowseOpts, Headers, Body) of
case db_request(post, Url, ["201", "202"], IbrowseOpts, Headers, Body) of
{ok, _, _, RespBody} ->
{ok, ejson:decode(RespBody)};
Error ->
Expand Down Expand Up @@ -598,7 +598,7 @@ put_attachment(#db{server=Server, options=IbrowseOpts}=Db, DocId, Name, Body, Op
couchbeam_util:encode_docid(DocId), "/",
couchbeam_util:encode_att_name(Name)], QueryArgs),

case db_request(put, Url, ["201"], IbrowseOpts, FinalHeaders, Body) of
case db_request(put, Url, ["201", "202"], IbrowseOpts, FinalHeaders, Body) of
{ok, _, _, RespBody} ->
{[{<<"ok">>, true}|R]} = ejson:decode(RespBody),
{ok, {R}};
Expand Down Expand Up @@ -635,7 +635,7 @@ delete_attachment(#db{server=Server, options=IbrowseOpts}=Db, DocOrDocId, Name,
Options1
end,
Url = make_url(Server, [db_url(Db), "/", DocId, "/", Name], Options2),
case db_request(delete, Url, ["200"], IbrowseOpts) of
case db_request(delete, Url, ["200", "202"], IbrowseOpts) of
{ok, _, _, RespBody} ->
{[{<<"ok">>,true}|R]} = ejson:decode(RespBody),
{ok, {R}};
Expand Down

0 comments on commit 8213e3f

Please sign in to comment.