From db0d9447cd18db2fc799a3537ec347bdc46e7bb7 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 15 Oct 2012 00:46:08 -0700 Subject: [PATCH] Write out objects sooner so we're more likely to have them after a crash. --- src/HashedObject.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/HashedObject.cpp b/src/HashedObject.cpp index 381df79df..bfa3d7ee1 100644 --- a/src/HashedObject.cpp +++ b/src/HashedObject.cpp @@ -35,15 +35,18 @@ bool HashedObjectStore::store(HashedObjectType type, uint32 index, HashedObject::pointer object = boost::make_shared(type, index, data, hash); if (!mCache.canonicalize(hash, object)) { +// cLog(lsTRACE) << "Queuing write for " << hash; boost::recursive_mutex::scoped_lock sl(mWriteMutex); mWriteSet.push_back(object); - if (!mWritePending && (mWriteSet.size() >= 64)) + if (!mWritePending) { mWritePending = true; boost::thread t(boost::bind(&HashedObjectStore::bulkWrite, this)); t.detach(); } } +// else +// cLog(lsTRACE) << "HOS: already had " << hash; return true; }