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
Added support for centralized dynamic config #24
Conversation
|
||
# Use managed dynamic configuration | ||
# Requires dynamic_config_root | ||
# Environment variable: RELAY_MANAGED_DYNAMIC_CONFIG |
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'll need to add this to the doc site: http://docs.operable.io/docs/relay-environment-variables
* Made the dynamic config refresh interval configurable * Immediately update dynamic config when the DCU starts to reduce update propagation latencies * Cleaned up interval reporting phrasing in general
defer dcu.refreshTimer.Reset(refreshInterval) | ||
var envelope messages.DynamicConfigsResponseEnvelope | ||
decoder := json.NewDecoder(bytes.NewReader(payload)) | ||
decoder.UseNumber() |
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.
One day, we should try and pull all the JSON decoding into a module so we don't have to keep repeating this same song and dance... 😦 . I'm afraid one day we're going to add something new and forget about this little wrinkle.
func (dcu *DynamicConfigUpdater) loop() { | ||
<-dcu.control | ||
dcu.refreshTimer.Stop() | ||
dcu.conn.Disconnect() |
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.
How does this loop?
d775b90
to
5e6433a
Compare
👍 |
ae58f69
to
b54815a
Compare
Wanted to get review on the code early while I'm working on test coverage.