Method
update_cache
(&self, files: Vec<IndexedFile>)
Source from the content-addressed store, hash-verified
| 196 | } |
| 197 | |
| 198 | async fn update_cache(&self, files: Vec<IndexedFile>) { |
| 199 | if !self.config.enable_cache { |
| 200 | return; |
| 201 | } |
| 202 | |
| 203 | let mut cache = self.cache.write().await; |
| 204 | cache.clear(); |
| 205 | for file in files { |
| 206 | cache.insert(file.path.clone(), file); |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | async fn get_files(&self) -> anyhow::Result<Vec<IndexedFile>> { |
| 211 | if self.config.enable_cache { |
Tested by
no test coverage detected