@platformatic/watt-admin 0.6.0-alpha.7 → 0.6.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/start.js +9 -4
  2. package/package.json +1 -1
package/lib/start.js CHANGED
@@ -66,14 +66,19 @@ export async function start (client, selectedRuntime) {
66
66
  await server.close()
67
67
  }
68
68
 
69
- process.once('SIGINT', async () => {
70
- process.on('SIGINT', () => {
71
- // we ignore future signals to avoid double shutdown
72
- })
69
+ async function recordAndShutdown () {
70
+ console.log('SIGINT received, recording metrics and shutting down...')
73
71
  clearTimeout(recordTimeout)
74
72
  await recordMetrics(entrypointUrl)
75
73
  await shutdown()
76
74
  process.removeAllListeners('SIGINT')
75
+ }
76
+
77
+ process.once('SIGINT', () => {
78
+ process.on('SIGINT', () => {
79
+ // we ignore future signals to avoid double shutdown
80
+ })
81
+ recordAndShutdown()
77
82
  })
78
83
 
79
84
  const { statusCode, body } = await requestRecord('start')
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@platformatic/watt-admin",
4
- "version": "0.6.0-alpha.7",
4
+ "version": "0.6.0-alpha.8",
5
5
  "scripts": {
6
6
  "prepublishOnly": "npm run clean && npm run build",
7
7
  "dev": "wattpm dev",