Merge pull request #933 from gaul/cache/remove-mirror-path

Remove mirror path when deleting cache
This commit is contained in:
Takeshi Nakatani 2019-01-27 16:15:49 +09:00 committed by GitHub
commit 3b1cc3b197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1829,11 +1829,21 @@ bool FdManager::DeleteCacheDirectory(void)
if(FdManager::cache_dir.empty()){
return true;
}
string cache_path;
if(!FdManager::MakeCachePath(NULL, cache_path, false)){
return false;
}
return delete_files_in_dir(cache_path.c_str(), true);
if(!delete_files_in_dir(cache_path.c_str(), true)){
return false;
}
string mirror_path = FdManager::cache_dir + "/." + bucket + ".mirror";
if(!delete_files_in_dir(mirror_path.c_str(), true)){
return false;
}
return true;
}
int FdManager::DeleteCacheFile(const char* path)