Claude/fix container package cache 01 xc43jr x6 lj42 v rxn9 vz46p#61
Open
slavaGanzin wants to merge 3 commits intojpillora:masterfrom
Open
Conversation
Added configurable cache TTL to address stale version caching in containerized deployments: - Added CacheTTL duration field to Config struct (configurable via CACHE_TTL env var) - Updated cache logic to use configurable TTL instead of hardcoded 1-hour constant - Added /clearcache endpoint for manual cache invalidation - Cache can be disabled entirely by setting CacheTTL to 0 - Default TTL remains 1 hour for backwards compatibility Changes made: - Modified handler/config.go: added CacheTTL field with time.Duration type - Modified handler/handler.go: removed cacheTTL constant, added /clearcache endpoint - Modified handler/handler_execute.go: updated execute() to use Config.CacheTTL - All tests pass successfully PROMPT: Hey when a repo releases is updated, it still installs previous versions, and I need to restart a container, so do you know what to do about it?
Removed configurable cache TTL configuration in favor of simpler solution: - Removed CacheTTL field from Config struct - Restored hardcoded 1-hour cache TTL constant - Kept /clearcache endpoint for manual cache invalidation Changes made: - Modified handler/config.go: removed CacheTTL field and time import - Modified handler/handler.go: restored cacheTTL constant, kept /clearcache endpoint - Modified handler/handler_execute.go: reverted to use cacheTTL constant - All tests pass successfully PROMPT: hey cut out CACHE_TTL, just leave the /clearcache
…e-01Xc43jrX6Lj42VRxn9VZ46p
Owner
|
I think id prefer an env var to configure cache, down to 0, no cache; rather than a clear cache endpoint anyone can hit |
Contributor
Author
|
Yeah, the first commit actually had this implementation, but then I thought that even though it can be called by anyone, it is still less vulnerable than setting CACHE_TTL to 0. Because if you do that, you could easily DDoS the installer when it fetches repeatedly from GitHub. On the other hand, with 90%, you would have a proxy in front of the installer, and you could limit that endpoint to the internal network or VPN, or not open it to the public. And adding an auth layer is definitely not within the scope of an installer, so it should be handled by other layer. But this endpoint probably should be configurable |
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.
There is 1 hour TTL for cache, and when I release a new version I want to refresh the cache