* Automatically prune the file status cache every day.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1025 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2008-01-01 14:13:14 +00:00
parent 7abc459d74
commit 77a7d13b39
4 changed files with 21 additions and 4 deletions
+13
View File
@@ -68,4 +68,17 @@ FileStatusCache::insert(const std::string& path, int flags) {
return true;
}
void
FileStatusCache::prune() {
iterator itr = begin();
while (itr != end()) {
rak::file_stat fs;
iterator tmp = itr++;
if (!fs.update(rak::path_expand(tmp->first)) || tmp->second.m_mtime != (uint32_t)fs.modified_time())
base_type::erase(tmp);
}
}
}