diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1,6 +1,11 @@ package main import ( + "log" + "os" + "os/signal" + "syscall" + "xengineering.eu/ceres/model" ) @@ -10,4 +15,10 @@ func main() { model.InitDatabase() defer model.CloseDatabase() + + listener := make(chan os.Signal) + signal.Notify(listener, syscall.SIGTERM) + signal.Notify(listener, syscall.SIGINT) + sig := <-listener + log.Printf("Cleaning up due to OS signal '%v'\n", sig) } |