Skip to content

debug: add an option to force the use of cached http responses#10955

Open
radoering wants to merge 1 commit into
python-poetry:mainfrom
radoering:perf/force-cache
Open

debug: add an option to force the use of cached http responses#10955
radoering wants to merge 1 commit into
python-poetry:mainfrom
radoering:perf/force-cache

Conversation

@radoering

Copy link
Copy Markdown
Member

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_CACHE environment 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 to contributing.md.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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

Successfully merging this pull request may close these issues.

1 participant