Log size before flush

pull/36/head
Tatsuhiro Tsujikawa 2012-12-06 03:04:41 +09:00
parent df5f1fe77f
commit a6b18c868b
1 changed files with 2 additions and 2 deletions

View File

@ -112,12 +112,12 @@ void WrDiskCache::ensureLimit()
{
while(total_ > limit_) {
EntrySet::iterator i = set_.begin();
total_ -= (*i)->getSize();
(*i)->writeToDisk();
WrDiskCacheEntry* ent = *i;
A2_LOG_DEBUG(fmt("Force flush cache entry size=%lu, clock=%"PRId64,
static_cast<unsigned long>(ent->getSizeKey()),
ent->getLastUpdate()));
total_ -= ent->getSize();
ent->writeToDisk();
set_.erase(i);
ent->setSizeKey(ent->getSize());