From 03ec23ec19c5b1b9b865f26c6680a5327706a6c8 Mon Sep 17 00:00:00 2001 From: Paul Joseph Davis Date: Wed, 25 Nov 2009 22:39:23 +0000 Subject: Fixed a bug preventing active_dbs from working. Thanks Jeff Macdonald for the report. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@884315 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_db_updater.erl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/couchdb') diff --git a/src/couchdb/couch_db_updater.erl b/src/couchdb/couch_db_updater.erl index 94414f2e..1da07326 100644 --- a/src/couchdb/couch_db_updater.erl +++ b/src/couchdb/couch_db_updater.erl @@ -656,8 +656,10 @@ commit_data(#db{fd=Fd,header=OldHeader,fsync_options=FsyncOptions}=Db, Delay) -> if OldHeader == Header -> Db; Delay and (Db#db.waiting_delayed_commit == nil) -> - Db#db{waiting_delayed_commit= - erlang:send_after(1000, self(), delayed_commit)}; + Db2 = Db#db{waiting_delayed_commit= + erlang:send_after(1000, self(), delayed_commit)}, + ok = gen_server:call(Db2#db.main_pid, {db_updated, Db2}), + Db2; Delay -> Db; true -> @@ -680,9 +682,11 @@ commit_data(#db{fd=Fd,header=OldHeader,fsync_options=FsyncOptions}=Db, Delay) -> _ -> ok end, - Db#db{waiting_delayed_commit=nil, + Db2 = Db#db{waiting_delayed_commit=nil, header=Header, - committed_update_seq=Db#db.update_seq} + committed_update_seq=Db#db.update_seq}, + %ok = gen_server:call(Db2#db.main_pid, {db_updated, Db2}), + Db2 end. -- cgit v1.2.3