debug: add an option to force the use of cached http responses#10955
Open
radoering wants to merge 1 commit into
Open
debug: add an option to force the use of cached http responses#10955radoering wants to merge 1 commit into
radoering wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider avoiding reading
POETRY_FORCE_HTTP_CACHEat import time inconstants.pyand instead evaluating it where the session/adapter is created, so that tests and long-lived processes can toggle the environment variable without needing to reload the module.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider avoiding reading `POETRY_FORCE_HTTP_CACHE` at import time in `constants.py` and instead evaluating it where the session/adapter is created, so that tests and long-lived processes can toggle the environment variable without needing to reload the module.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am not completely sure if it makes sense to commit this or if there is a better solution but I think it is useful when conducting performance comparisons.
A cache that becomes stale during performance measurements can skew the results. This PR introduces a
POETRY_FORCE_HTTP_CACHEenvironment variable that forces using the cache even if it is stale. At first, I thought there is no need to document this but since it is useful for contributors I added it tocontributing.md.