Skip to content

Commit

Permalink
fix: Remove caching for project globbing. (#639)
Browse files Browse the repository at this point in the history
Fix globs.
  • Loading branch information
milesj authored Feb 21, 2023
1 parent 5ee1f3b commit 81b0ebd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
19 changes: 7 additions & 12 deletions crates/core/project-graph/src/project_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use rustc_hash::{FxHashMap, FxHashSet};
use std::collections::BTreeMap;
use std::mem;
use std::path::PathBuf;
use std::time::Duration;

pub struct ProjectGraphBuilder<'ws> {
workspace: &'ws mut Workspace,
Expand Down Expand Up @@ -485,19 +484,15 @@ impl<'ws> ProjectGraphBuilder<'ws> {
};

if !globs.is_empty() {
if time::is_stale(cache.last_glob_time, Duration::from_secs(60 * 5)) {
debug!(
target: LOG_TARGET,
"Finding projects with globs: {}",
map_list(&globs, |g| color::file(g))
);
debug!(
target: LOG_TARGET,
"Finding projects with globs: {}",
map_list(&globs, |g| color::file(g))
);

detect_projects_with_globs(&self.workspace.root, &globs, &mut sources)?;
detect_projects_with_globs(&self.workspace.root, &globs, &mut sources)?;

cache.last_glob_time = time::now_millis();
} else {
sources.extend(cache.projects);
}
cache.last_glob_time = time::now_millis();
}

// Load project aliases
Expand Down
1 change: 1 addition & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#### 🐞 Fixes

- Fixed an issue where `moon query projects --affected` would hang indefinitely waiting for stdin.
- Fixed an issue where changing `projects` globs wouldn't immediately invalidate the cache.

## 0.24.2

Expand Down

0 comments on commit 81b0ebd

Please sign in to comment.