Skip to content

Commit

Permalink
update zest.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
kfatyuip committed Aug 4, 2024
1 parent 701d3d0 commit 9552986
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/zest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ async fn init_cache() -> io::Result<()> {
tokio::spawn(async move {
loop {
if _b {
let mut index_cache = INDEX_CACHE.try_lock().unwrap();
index_cache.pop_lru();
} else {
let mut file_cache = FILE_CACHE.try_lock().unwrap();
if let Some(mut index_cache) = INDEX_CACHE.try_lock() {
index_cache.pop_lru();
}
} else if let Some(mut file_cache) = FILE_CACHE.try_lock() {
file_cache.pop_lru();
}
_b = !_b;
Expand Down

0 comments on commit 9552986

Please sign in to comment.