summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_httpd_db.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index cdc74610..32fc1b11 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -155,9 +155,13 @@ keep_sending_changes(#httpd{user_ctx=UserCtx,path_parts=[DbName|_]}=Req, Resp,
true ->
case wait_db_updated(Timeout, TimeoutFun) of
updated ->
- {ok, Db2} = couch_db:open(DbName, [{user_ctx, UserCtx}]),
- keep_sending_changes(Req, Resp, Db2, EndSeq, Prepend2, Timeout,
- TimeoutFun, ResponseType, NewLimit, Filter, End);
+ case couch_db:open(DbName, [{user_ctx, UserCtx}]) of
+ {ok, Db2} ->
+ keep_sending_changes(Req, Resp, Db2, EndSeq, Prepend2, Timeout,
+ TimeoutFun, ResponseType, NewLimit, Filter, End);
+ _Else ->
+ end_sending_changes(Resp, EndSeq, ResponseType)
+ end;
stop ->
end_sending_changes(Resp, EndSeq, ResponseType)
end