-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Issue #937 - Use redis as a shared throwaway cache #1120
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1120 +/- ##
==========================================
- Coverage 37.32% 37.04% -0.29%
==========================================
Files 53 53
Lines 7729 7734 +5
==========================================
- Hits 2885 2865 -20
- Misses 4414 4440 +26
+ Partials 430 429 -1
Continue to review full report at Codecov.
|
util/cache/cache.go
Outdated
} | ||
client := redis.NewClient(&redis.Options{ | ||
Addr: redisAddress, | ||
Password: "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider having a shared password mapped from argocd-secret.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. Added flag for db and env variable for password
util/cache/cache.go
Outdated
client := redis.NewClient(&redis.Options{ | ||
Addr: redisAddress, | ||
Password: "", | ||
DB: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think redis DB should also be exposed as a command line flag.
} | ||
|
||
func appManagedResourcesKey(appName string) string { | ||
return fmt.Sprintf("app|managed-resources|%s", appName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should consider prefixing something like a db "version" to the keys so that when we make changes to the responses, we bump the version and the cache is automatically invalidated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already implemented in getItem
/setItem
methods. As we agreed offline switched to separete const for cache version.
d91b48c
to
f99b163
Compare
Closes #937