summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go19
1 files changed, 0 insertions, 19 deletions
diff --git a/main.go b/main.go
index 483633c..3cf6fa7 100644
--- a/main.go
+++ b/main.go
@@ -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)
- }()
-}