-
Notifications
You must be signed in to change notification settings - Fork 469
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
fix: Cache the Config #933
Conversation
Coverage Report •
|
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.
Looks great! Just wondering, how much effort do you think it would be to add an endpoint to the chat app to reset/clear the config that we call after saving? The caveat being that if their are multiple instances of the chat app it won't work. But not sure if that's something we allow to be configured. WDYT?
I was actually thinking about this. However, I think the problem would be the dependency graph of the deployment. We would need the chat app deployed to be able to get the url (unless we did it by convention), but the backend is what is deployed last; and it would be the admin app calling the backend. But not saying no, let me give it a weekend thought! |
Ah good point! I guess another option could be to have a ttl on the cache, is that possible with func tools? |
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.
Nice
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.
LGTM!
Purpose
Fixes #647
We use the higher-order functions to decorate the
get_active_config_or_default
method with a cache. We also invalidate the cache when we save the config.However, because there are 2 applications, we display some text to tell the user that they will need to restart the Chat App to invalidate the cache