sigint.go: close DB connection before exit

Closes https://gitlab.com/commento/commento/issues/88
This commit is contained in:
Adhityaa Chandrasekar 2019-05-01 18:39:40 -04:00
parent 0b37b33530
commit 9d4ed4ca9f

View File

@ -7,7 +7,14 @@ import (
)
func sigintCleanup() int {
// TODO: close the database connection and do other cleanup jobs
if db != nil {
err := db.Close()
if err == nil {
logger.Errorf("cannot close database connection: %v", err)
return 1
}
}
return 0
}