diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-12-06 03:04:41 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-12-06 03:04:41 +0900 |
| commit | a6b18c868bcf32ddb14ddea79281fa3c12e22803 (patch) | |
| tree | f2bf22bce14c7f3dea2d17a2a58b13e5694cf861 /src/WrDiskCache.cc | |
| parent | df5f1fe77fac127c10af35b218ce613cbc33db1e (diff) | |
Log size before flush
Diffstat (limited to 'src/WrDiskCache.cc')
| -rw-r--r-- | src/WrDiskCache.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/WrDiskCache.cc b/src/WrDiskCache.cc index 79af80e9..cd204ea6 100644 --- a/src/WrDiskCache.cc +++ b/src/WrDiskCache.cc @@ -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()); |
