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

custom_components._get_package_config called numerous times #3341

Open
ericwb opened this issue May 19, 2024 · 0 comments
Open

custom_components._get_package_config called numerous times #3341

ericwb opened this issue May 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ericwb
Copy link
Contributor

ericwb commented May 19, 2024

Describe the bug
The function _get_package_config is called several times under normal operation of the reflex run publish command. The _get_package_config makes an IO call to load the pyproject.toml file. While not a huge issue, this is unnecessary to reload the file multiple times.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
Typically, you only want to load a configuration file once and use the results. Or alternatively cache the results for future reference.

Screenshots
n/a

Specifics (please complete the following information):

  • Python Version: 3.12.2
  • Reflex Version: 0.5.0.post1
  • OS: macOS Sonoma 14.4.1
  • Browser (Optional): n/a

Additional context
Add any other context about the problem here.

@ericwb ericwb added the bug Something isn't working label May 19, 2024
ericwb added a commit to ericwb/reflex that referenced this issue May 19, 2024
This change adds the functools cache decorator to avoid repeated
calls to _get_package_config, which results in IO hits to read
a file.

Closes reflex-dev#3341

Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
ericwb added a commit to ericwb/reflex that referenced this issue May 19, 2024
This change adds the functools cache decorator to avoid repeated
calls to _get_package_config, which results in IO hits to read
a file.

Closes reflex-dev#3341

Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant