mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-06 16:20:08 +00:00
fix: do not remove cache dir completely
This commit is contained in:
parent
fc614eadb8
commit
8560c0b3a6
1 changed files with 3 additions and 1 deletions
|
|
@ -159,7 +159,9 @@ impl CandidateService {
|
||||||
pub async fn delete_cache(candidate_id: i32) -> Result<(), ServiceError> {
|
pub async fn delete_cache(candidate_id: i32) -> Result<(), ServiceError> {
|
||||||
let cache_path = Path::new(&candidate_id.to_string()).join("cache");
|
let cache_path = Path::new(&candidate_id.to_string()).join("cache");
|
||||||
|
|
||||||
tokio::fs::remove_dir_all(cache_path).await?;
|
tokio::fs::remove_dir_all(&cache_path).await?;
|
||||||
|
// Recreate blank cache directory
|
||||||
|
tokio::fs::create_dir_all(&cache_path).await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue