Skip to content
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

Add option to try other caches when NEAREST_CACHE fails #119

Open
matyasselmeci opened this issue Aug 24, 2020 · 5 comments
Open

Add option to try other caches when NEAREST_CACHE fails #119

matyasselmeci opened this issue Aug 24, 2020 · 5 comments
Assignees

Comments

@matyasselmeci
Copy link
Contributor

Now that #118 added trying multiple caches, it would be useful to have an environment variable that tells stashcp to try NEAREST_CACHE first, but still fall back to other caches. The use case for this is to set NEAREST_CACHE to a private cache, but fall back to the public caches if it's down or overloaded.

We could have it off by default and name it something like NEAREST_CACHE_FALLBACK=1, or on by default and name it something like NEAREST_CACHE_ONLY=1.

@djw8605
Copy link
Member

djw8605 commented Aug 26, 2020

Just to be clear on this. There are 2 options you are proposing:

  1. If NEAREST_CACHE environment variable is set, then use that as the first cache to try. But continue to fall back to the others. So, just add it to the front of the list of nearest caches (with duplicate removal if it's already in the list)
  2. If NEAREST_CACHE is set, check if NEAREST_CACHE_ONLY is set and if so, only attempt the nearest cache. This would have the same effect as specifying --cache on the command line.

@matyasselmeci
Copy link
Contributor Author

Yep. Either one of those would work for me.

@djw8605
Copy link
Member

djw8605 commented Aug 26, 2020

I'm confused by your "either one", do you not want both?

@matyasselmeci
Copy link
Contributor Author

(2) means do (1) and also add NEAREST_CACHE_ONLY, right? For me (2) is optional, it just gives people a way to get the current behavior back once we do (1).

@djw8605
Copy link
Member

djw8605 commented Aug 26, 2020

Ok, makes sense. I forgot we already have NEAREST_CACHE functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants