sigint.go: close DB connection before exit
Closes https://gitlab.com/commento/commento/issues/88
This commit is contained in:
parent
0b37b33530
commit
9d4ed4ca9f
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user