mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-09 03:32:29 +00:00
* 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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user