improve logging
This commit is contained in:
parent
82104bfd20
commit
69830aea7a
1 changed files with 4 additions and 0 deletions
|
@ -40,6 +40,8 @@ try {
|
|||
}
|
||||
|
||||
const db = new sqlite.DatabaseSync(config["database"])
|
||||
console.log("Database opened")
|
||||
|
||||
migrateDB(db)
|
||||
|
||||
const reasonProcessExiting = "__processExiting__"
|
||||
|
@ -114,7 +116,9 @@ function newClient() {
|
|||
function end() {
|
||||
console.log("Detected end, quitting")
|
||||
client.end(reasonProcessExiting)
|
||||
|
||||
db.close()
|
||||
console.log("Database closed")
|
||||
}
|
||||
|
||||
process.on("SIGINT", end)
|
||||
|
|
Loading…
Add table
Reference in a new issue