diff options
Diffstat (limited to 'main.lua')
| -rw-r--r-- | main.lua | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -1,4 +1,5 @@ local cqueues = require'cqueues' +local signal = require'cqueues.signal' local class = require'r.class' local pprint = require'pprint' @@ -46,9 +47,8 @@ function Wilson.make(cls, conf) return self end -function Wilson.add_channels_for(self, pylon, busses) +function Wilson.add_channels_for(self, pylon) if not pylon.channels then return end - busses = busses or self.busses for busname, bus in pairs(busses) do for _, channel in ipairs(bus) do if channel.pylon == pylon @@ -77,9 +77,19 @@ function Wilson.run(self) self.log("now running pylon", pylonname) end self.cq:wrap(self.store.run, self.store) + self.cq:wrap(self.hup, self) self.log:loop(self.cq) end +function Wilson.hup(self) + signal.block(signal.SIGHUP) + local sl = signal.listen(signal.SIGHUP) + while true do + local s = sl:wait() + self:reload_config() + end +end + local config_file = assert(io.open("wilson.ini","r")) local conf = config.parse(config_file) config_file:close() |
