Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Clear cached content #2833

Merged
merged 1 commit into from
Oct 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dapps/src/apps/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ impl ContentCache {
},
ContentStatus::Ready(ref endpoint) => {
trace!(target: "dapps", "Removing {} because of limit.", entry.0);
// Remove path
let res = fs::remove_dir_all(&endpoint.path());
// Remove path (dir or file)
let res = fs::remove_dir_all(&endpoint.path()).or_else(|_| fs::remove_file(&endpoint.path()));
if let Err(e) = res {
warn!(target: "dapps", "Unable to remove dapp: {:?}", e);
warn!(target: "dapps", "Unable to remove dapp/content from cache: {:?}", e);
}
}
}
Expand Down