// Listens for the HUP system signal and gracefuly reloads the timers from database. func reloadSchedulerSingnalHandler(sched *scheduler.Scheduler, getter engine.AccountingStorage) { for { c := make(chan os.Signal) signal.Notify(c, syscall.SIGHUP) sig := <-c engine.Logger.Info(fmt.Sprintf("Caught signal %v, reloading action timings.\n", sig)) sched.LoadActionTimings(getter) // check the tip of the queue for new actions sched.Restart() } }