Add an abstraction layer around configuration reloading
Review Request #9841 — Created March 27, 2018 and submitted — Latest diff uploaded
Previously, running
touch config.json
would result in the server
reloading, but if the configuratino file was overwritten (say by a text
editor), rb-gateway would crash. Now we have aConfigWatcher
abstraction that wrapsfsnotify
to (1) wait for the file to be written
and (2) re-watch the file. It also provides a utility to force reload
the configuration (which is triggered bySIGHUP
currently).
- Ran unit tests.
- Ran
touch config.json
and saw the config reloaded. - Edited
config.json
and saw the config reloaded (and rb-gateway did
not crash). kill -sHUP (pgrep rb-gateway)
and saw the config reloaded.