couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r817398 - /couchdb/trunk/src/couchdb/couch_httpd_db.erl
Date Mon, 21 Sep 2009 20:18:41 GMT
Author: kocolosk
Date: Mon Sep 21 20:18:41 2009
New Revision: 817398

URL: http://svn.apache.org/viewvc?rev=817398&view=rev
Log:
bugfix for _changes when DB is deleted mid-response

Modified:
    couchdb/trunk/src/couchdb/couch_httpd_db.erl

Modified: couchdb/trunk/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_db.erl?rev=817398&r1=817397&r2=817398&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_db.erl Mon Sep 21 20:18:41 2009
@@ -155,9 +155,13 @@
     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



Mime
View raw message