-
Notifications
You must be signed in to change notification settings - Fork 219
Add UNSTABLE_CACHE_KEY
environment variable
#990
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
Conversation
32e4d48
to
ec564bd
Compare
Tidy up cache_directory.rs Signed-off-by: Simon Beal <simobeal@amazon.com>
…n<OsString>` Signed-off-by: Simon Beal <simobeal@amazon.com>
Signed-off-by: Simon Beal <simobeal@amazon.com>
Signed-off-by: Simon Beal <simobeal@amazon.com>
270150a
to
18807d6
Compare
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.
LGTM. Remaining suggestions are optional.
Signed-off-by: Simon Beal <simobeal@amazon.com>
Signed-off-by: Simon Beal <simobeal@amazon.com>
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.
LGTM
let managed_cache_path = match cache_key { | ||
None => mountpoint_cache_path.clone(), | ||
Some(cache_key) => mountpoint_cache_path.join(hash_cache_key(cache_key.as_bytes())), | ||
Some(ref cache_key) => mountpoint_cache_path.join(hash_cache_key(cache_key.as_bytes())), |
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.
FYI: this is fine, but we usually prefer using a reference in the match, like this:
let managed_cache_path = match &cache_key {
None => mountpoint_cache_path.clone(),
Some(cache_key) => mountpoint_cache_path.join(hash_cache_key(cache_key.as_bytes())),
};
Description of change
Add
UNSTABLE_CACHE_KEY
environment variable.Using
UNSTABLE_CACHE_KEY
allows users to specify a cache path disambiguator. This key can be used to ensure that cache directories are unique, even if the cache directory specified is shared.Relevant issues: N/A
Does this change impact existing behavior?
No breaking changes. This will change behaviour when the
UNSTABLE_CACHE_KEY
variable is passed.Does this change need a changelog entry in any of the crates?
No, this is being added as an unstable feature without documentation or promise for continued support.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).