-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support Configuration Hot Reloading #346
Conversation
todo: consider refactor to use channel instead of function pointer
Libyears is 3.45 |
Code coverage is 89.1% |
Libyears is 2.42 |
Libyears is 2.42 |
Code coverage is 89.1% |
1 similar comment
Code coverage is 89.1% |
internal/server/tile_handler.go
Outdated
@@ -70,9 +73,21 @@ func newTileHandler(handler defaultHandler) (tileHandler, error) { | |||
}, errors.Join(err1, err2, err3, err4) | |||
} | |||
|
|||
func (h *tileHandler) reloadEntities(newEntities reloadableEntities) { | |||
slog.WarnContext(pkg.BackgroundContext(), "Requesting to refresh entities from configuration") | |||
h.mux.Lock() |
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.
Do I really need this mutex? I put it in thinking I'd need to do multiple setters but given it ended up being just one, that should be atomic right?
Libyears is 2.42 |
Code coverage is 89.1% |
Libyears is 2.42 |
7199ffb
to
ac7f4c2
Compare
Libyears is 2.42 |
Code coverage is 89.1% |
1 similar comment
Code coverage is 89.1% |
Implements #198
Adds a new CLI flag when running serve command to enable hot reloading of configuration whenever the file changes. Relies on viper's wrapper for fsnotify hooks so doesn't yet support etcd/other remote providers. Includes documentation of what can be reloaded. Limited to the main tile serve endpoint.