diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -1,35 +1,16 @@ package main import ( - "database/sql" "log" - "os" - "os/signal" - "syscall" "text/template" ) var config RuntimeConfig -var db *sql.DB var templates *template.Template func main() { log.Printf("Started Ceres recipe server.\n") config = GetRuntimeConfig() templates = setupTemplates() - db = setupDatabase() - provideShutdown() runServer() } - -func provideShutdown() { - var listener = make(chan os.Signal) - signal.Notify(listener, syscall.SIGTERM) - signal.Notify(listener, syscall.SIGINT) - go func() { - signal := <-listener - log.Printf("Got signal '%+v'. Shutdown is started.\n", signal) - dbCleanup(db) - os.Exit(0) - }() -} |