acceptSignals registers for OS signals
(migrationContext *base.MigrationContext)
| 43 | |
| 44 | // acceptSignals registers for OS signals |
| 45 | func acceptSignals(migrationContext *base.MigrationContext) { |
| 46 | c := make(chan os.Signal, 1) |
| 47 | |
| 48 | signal.Notify(c, syscall.SIGHUP) |
| 49 | go func() { |
| 50 | for sig := range c { |
| 51 | switch sig { |
| 52 | case syscall.SIGHUP: |
| 53 | migrationContext.Log.Infof("Received SIGHUP. Reloading configuration") |
| 54 | if err := migrationContext.ReadConfigFile(); err != nil { |
| 55 | log.Errore(err) |
| 56 | } else { |
| 57 | migrationContext.MarkPointOfInterest() |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | }() |
| 62 | } |
| 63 | |
| 64 | // main is the application's entry point. It will either spawn a CLI or HTTP interfaces. |
| 65 | func main() { |
no test coverage detected
searching dependent graphs…