summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_server.erl
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2009-02-17 14:01:51 +0000
committerDamien F. Katz <damien@apache.org>2009-02-17 14:01:51 +0000
commit3b431fc0b30c5fb110afd06347058727724f0fb2 (patch)
tree5370bd65fdf8a586d415a03da6c5fb367d569f25 /src/couchdb/couch_server.erl
parent15976c8008473c9d8a97e0bf50f760faab12ee15 (diff)
Put file ref_counting into it's own module, to make the speed of opening an already open database faster (by not waiting on file pending operations, particularly fsync).
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@745076 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_server.erl')
-rw-r--r--src/couchdb/couch_server.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl
index 69cfa36c..39b33c63 100644
--- a/src/couchdb/couch_server.erl
+++ b/src/couchdb/couch_server.erl
@@ -195,15 +195,15 @@ try_close_lru(StartTime) ->
true ->
[{_, DbName}] = ets:lookup(couch_dbs_by_lru, LruTime),
[{_, {MainPid, LruTime}}] = ets:lookup(couch_dbs_by_name, DbName),
- case couch_db:num_refs(MainPid) of
- 0 ->
+ case couch_db:is_idle(MainPid) of
+ true ->
exit(MainPid, kill),
receive {'EXIT', MainPid, _Reason} -> ok end,
true = ets:delete(couch_dbs_by_lru, LruTime),
true = ets:delete(couch_dbs_by_name, DbName),
true = ets:delete(couch_dbs_by_pid, MainPid),
ok;
- _NumRefs ->
+ false ->
% this still has referrers. Go ahead and give it a current lru time
% and try the next one in the table.
NewLruTime = now(),