Add an abstraction layer around configuration reloading

Review Request #9841 — Created March 27, 2018 and submitted — Latest diff uploaded

brennie
rb-gateway
master
9839
c03b5cc...
rb-gateway

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 a ConfigWatcher
abstraction that wraps fsnotify 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 by SIGHUP 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.
Loading...