-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): add fallback cache for db cache #27841
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
const error = [ | ||
`Invalid Cache Directory for Task "${task.id}"`, | ||
`The local cache artifact in "${cacheDir}" was found in ${cacheDir}.`, | ||
`When using the database cache, cache artifacts are stored in a database within ${workspaceDataDirectory}.`, | ||
``, | ||
`If you believe this is a mistake, running \`nx reset\` will clear the cache and allow it to be repopulated.`, | ||
`Alternatively, setting NX_REJECT_UNKNOWN_LOCAL_CACHE to false will bypass this check.`, | ||
``, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FrozenPandaz this is the spot we should tune the error message a bit.
7f0b5c6
to
cf8abda
Compare
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 221e713. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 4 targets
Sent with 💌 from NxCloud. |
1c9f6ca
to
09b66a4
Compare
packages/nx/src/native/db/mod.rs
Outdated
"{}.db", | ||
match db_name { | ||
Some(name) => name, | ||
None => machine_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call the get_machine_id()
in here
packages/nx/src/native/db/mod.rs
Outdated
let db_path = cache_dir_buf.join(format!("{}.db", machine_id)); | ||
let db_path = cache_dir_buf.join(format!( | ||
"{}.db", | ||
match db_name { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be more idiomatic
db_name.unwrap_or_else(|| get_machine_id())
if (cacheDir !== defaultCacheDir) { | ||
this.fallbackDbCache = new NxCache( | ||
workspaceRoot, | ||
process.env.NX_SHARED_CACHE_DIRECTORY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be cacheDir
// hit issues. If we detect this, we can create a fallback db cache in the | ||
// custom directory, and check if the entries are there when the main db | ||
// cache misses. | ||
if (cacheDir !== defaultCacheDir) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should implement some kind of "cache reflects fs state"
995d6ac
to
221e713
Compare
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Expected Behavior
Related Issue(s)
Fixes #