Small WAL cleanup.

This commit is contained in:
JoelKatz
2013-04-18 16:16:52 -07:00
parent 4f87d95add
commit 51b1cb17a0

View File

@@ -223,18 +223,19 @@ bool SqliteDatabase::setupCheckpointing(JobQueue *q)
void SqliteDatabase::doHook(const char *db, int pages)
{
if (pages < 1024)
if (pages < 1000)
return;
boost::mutex::scoped_lock sl(walMutex);
if (!walRunning)
{
boost::mutex::scoped_lock sl(walMutex);
if (walRunning)
return;
walRunning = true;
}
if (mWalQ)
mWalQ->addJob(jtWAL, std::string("WAL:") + mHost, boost::bind(&SqliteDatabase::runWal, this));
else
boost::thread(boost::bind(&SqliteDatabase::runWal, this)).detach();
}
}
void SqliteDatabase::runWal()
{