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

Cache stat of addon assets #4675

Closed
wants to merge 2 commits into from

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Nov 7, 2023

Proposed change

Since we poll the addons quite a bit we did a lot of stat()s in the event loop

I wasn't 100% sure if the cache of these ever needed to be cleared though.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to cli pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints of add-on configuration are added/changed:

Since we poll the addons quite a bit we did a lot of stat()s
in the event loop
@mdegat01
Copy link
Contributor

mdegat01 commented Nov 7, 2023

The cache would have to be cleared on update of the addon data. An update could change one of those values from false to true or vice versa.

@bdraco
Copy link
Member Author

bdraco commented Nov 7, 2023

The cache would have to be cleared on update of the addon data. An update could change one of those values from false to true or vice versa.

271428e

I did it for rebuilds too just to be safe and married it to self.sys_addons.data.update

@bdraco bdraco marked this pull request as ready for review November 7, 2023 21:22
@bdraco
Copy link
Member Author

bdraco commented Nov 7, 2023

The current design doesn't know when the data changes so we don't have a good way to expire the cache.

Sadly stat()s are blocking I/O in the event loop but we can't get rid of them right now

@bdraco bdraco closed this Nov 7, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants