Skip to content

Commit aad2021

Browse files
committed
remove unncessary directory creation
1 parent 361128a commit aad2021

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

  • crates/vite_task/src/session

crates/vite_task/src/session/mod.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,7 @@ impl<'a, CustomSubcommand> Session<'a, CustomSubcommand> {
204204
/// The cache is only created when first accessed to avoid SQLite race conditions
205205
/// when multiple processes start simultaneously.
206206
pub fn cache(&self) -> anyhow::Result<&ExecutionCache> {
207-
self.cache.get_or_try_init(|| {
208-
// Create cache directory if needed
209-
if !self.cache_path.as_path().exists() {
210-
if let Some(cache_dir) = self.cache_path.as_path().parent() {
211-
tracing::info!("Creating task cache directory at {}", cache_dir.display());
212-
std::fs::create_dir_all(cache_dir)?;
213-
}
214-
}
215-
ExecutionCache::load_from_path(self.cache_path.clone())
216-
})
207+
self.cache.get_or_try_init(|| ExecutionCache::load_from_path(self.cache_path.clone()))
217208
}
218209

219210
pub fn workspace_path(&self) -> Arc<AbsolutePath> {

0 commit comments

Comments
 (0)