From 1bfe0e7c67de9a0d3e2daccd971708d6a1b6067c Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 3 May 2024 19:56:20 -0700 Subject: [PATCH] fix(scheduler): when git directory doesn't exist (maybe caused by a failed clone), simply skip it (#2046) --- crates/tabby-scheduler/src/cache.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/tabby-scheduler/src/cache.rs b/crates/tabby-scheduler/src/cache.rs index 875038100889..d8f64e6deef9 100644 --- a/crates/tabby-scheduler/src/cache.rs +++ b/crates/tabby-scheduler/src/cache.rs @@ -112,7 +112,10 @@ impl CacheStore { &self.dataset_bucket(repository), |meta_bucket, repo_bucket| { let last_sync_commit = self.get_meta(&meta_bucket, repository).last_sync_commit; - let current_version = get_git_commit(&dir).unwrap(); + let Ok(current_version) = get_git_commit(&dir) else { + warn!("Failed to get current version for {dir:?}, skipping..."); + return Ok(()); + }; let Some(old_version) = last_sync_commit else { self.sync_repository_from_scratch(