mirror of
https://gitlab.com/commento/commento.git
synced 2026-11-01 01:16:21 -05:00
sigint.go: close DB connection before exit
Closes https://gitlab.com/commento/commento/issues/88
This commit is contained in:
1 parent
0b37b33530
commit
9d4ed4ca9f
1 file changed
+8
-1
+8
-1
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user