Add an abstraction layer around configuration reloading

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

Barret Rennie
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.
David Trowbridge
  1. Ship It!
  2. 
      
Barret Rennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (d08033a)
Loading...