소스 검색

Log size before flush

Tatsuhiro Tsujikawa 13 년 전
부모
커밋
a6b18c868b
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/WrDiskCache.cc

+ 2 - 2
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());