Clear cached content (#2833)
This commit is contained in:
parent
e0207b594b
commit
a293493f93
@ -66,10 +66,10 @@ impl ContentCache {
|
|||||||
},
|
},
|
||||||
ContentStatus::Ready(ref endpoint) => {
|
ContentStatus::Ready(ref endpoint) => {
|
||||||
trace!(target: "dapps", "Removing {} because of limit.", entry.0);
|
trace!(target: "dapps", "Removing {} because of limit.", entry.0);
|
||||||
// Remove path
|
// Remove path (dir or file)
|
||||||
let res = fs::remove_dir_all(&endpoint.path());
|
let res = fs::remove_dir_all(&endpoint.path()).or_else(|_| fs::remove_file(&endpoint.path()));
|
||||||
if let Err(e) = res {
|
if let Err(e) = res {
|
||||||
warn!(target: "dapps", "Unable to remove dapp: {:?}", e);
|
warn!(target: "dapps", "Unable to remove dapp/content from cache: {:?}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user