Skip to content

Commit

Permalink
fix(scheduler): when there's no repositories got configured, skip the…
Browse files Browse the repository at this point in the history
… garbage collection (#2279)
  • Loading branch information
wsxiaoys authored May 29, 2024
1 parent fcdfc8a commit c075541
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/tabby-scheduler/src/code/repository.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ pub fn sync_repository(repository: &RepositoryConfig) {
pub fn garbage_collection(repositories: &[RepositoryConfig]) {
let names = repositories.iter().map(|r| r.dir()).collect::<HashSet<_>>();

for file in fs::read_dir(repositories_dir())
.expect("Failed to read repository dir")
.filter_map(Result::ok)
{
let Ok(dir) = fs::read_dir(repositories_dir()) else {
return;
};

for file in dir.filter_map(Result::ok) {
let metadata = file.metadata().expect("Failed to read metadata");
let filename = file.file_name();
if metadata.is_file() {
Expand Down

0 comments on commit c075541

Please sign in to comment.