Browse Source

Update shutdown logging

pull/7478/head
Rory Powell 4 years ago
parent
commit
ae3e4a7d6e
  1. 2
      packages/cli/package.json
  2. 8
      packages/server/src/app.ts
  3. 1
      packages/server/src/automations/bullboard.js
  4. 1
      packages/server/src/threads/index.ts
  5. 4
      packages/worker/src/index.ts

2
packages/cli/package.json

@ -26,7 +26,7 @@
"outputPath": "build"
},
"dependencies": {
"@budibase/backend-core": "1.1.32-alpha.6",
"@budibase/backend-core": "1.2.47",
"axios": "0.21.2",
"chalk": "4.1.0",
"cli-progress": "3.11.2",

8
packages/server/src/app.ts

@ -74,9 +74,7 @@ server.on("close", async () => {
return
}
shuttingDown = true
if (!env.isTest()) {
console.log("Server Closed")
}
console.log("Server Closed")
await automations.shutdown()
await redis.shutdown()
await events.shutdown()
@ -158,3 +156,7 @@ process.on("uncaughtException", err => {
process.on("SIGTERM", () => {
shutdown()
})
process.on("SIGINT", () => {
shutdown()
})

1
packages/server/src/automations/bullboard.js

@ -53,6 +53,7 @@ exports.shutdown = async () => {
await automationQueue.close()
automationQueue = null
}
console.log("Bull shutdown")
}
exports.queue = automationQueue

1
packages/server/src/threads/index.ts

@ -106,5 +106,6 @@ export class Thread {
static async shutdown() {
await Thread.stopThreads()
console.log("Threads shutdown")
}
}

4
packages/worker/src/index.ts

@ -63,9 +63,7 @@ server.on("close", async () => {
return
}
shuttingDown = true
if (!env.isTest()) {
console.log("Server Closed")
}
console.log("Server Closed")
await redis.shutdown()
await events.shutdown()
if (!env.isTest()) {

Loading…
Cancel
Save