-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
Fix environment cache regression #1238
Conversation
I agree. This attempt at fixing this does use the cache even more. I think we just need to check if |
The code may seem to be weird, but I have tested it and the cache is really used. |
Yes, but only if |
Why? |
My logic was a bit off, but what I said still applies. If |
I have dug into the code and found what's wrong with me. Apologize for my reckless. |
Sorry, I find that I'm wrong again. |
Should we consider the situation that people switch virtual environment to real environment? |
This was my attempt: def get_cached_default_environment():
return _get_cached_default_environment(os.environ.get('VIRTUAL_ENV'))
@time_cache(seconds=10 * 60) # 10 Minutes
def _get_cached_default_environment(_venv):
return get_default_environment() Much simpler, IMO. |
This fix sloved my problem |
The solution of @heftig has the issue that it doesn't clean the cache if it encounters something different. I don't really like that (because that would mean keeping around processes longer than necessary). The only remaining issue with this PR is that it does compare with |
Any news on this ? |
@bet4it and everyone else: Thanks a lot for your patience. I was very demotivated lately to visit the issue tracker. Therefore this was lingering around here way longer than it should have. Sorry! I guess I will have a bit more motivation once I have the typeshed stuff merged. There's this one small issue that I'm going to fix, but you don't need to care anymore. |
I actually just realized that my criticism was wrong anyway. This could have been merged way sooner... |
I only just realized how bad this issue was. Big sorry for that. I therefore did a release immediately. (0.13.2) |
No need for sorry, @davidhalter! Jedi is a great tool and everybody who uses it appreciates all the hard work you put in! |
Currently, if
VIRTUAL_ENV
is empty, which will occur when we don't use a virtual environment, theget_cached_default_environment
will always clear the cache.I think it's a regression caused by 862f611.