@platformatic/basic 2.8.0-alpha.1 → 2.8.0-alpha.2

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.
package/lib/base.js CHANGED
@@ -38,7 +38,7 @@ export class BaseStackable {
38
38
  this.startHttpTimer = null
39
39
  this.endHttpTimer = null
40
40
  this.clientWs = null
41
- this.runtimeConfig = workerData?.config ?? null
41
+ this.runtimeConfig = deepmerge(options.context.runtimeConfig ?? {}, workerData?.config ?? {})
42
42
 
43
43
  // Setup the logger
44
44
  const pinoOptions = {
@@ -251,20 +251,22 @@ export class BaseStackable {
251
251
  }
252
252
 
253
253
  async stopCommand () {
254
+ const exitTimeout = this.runtimeConfig.gracefulShutdown.runtime
255
+
254
256
  this.#subprocessStarted = false
255
257
  const exitPromise = once(this.subprocess, 'exit')
256
258
 
257
259
  // Attempt graceful close on the process
258
260
  this.childManager.notify(this.clientWs, 'close')
259
261
 
260
- // If the process hasn't exited in 10 seconds, kill it in the polite way
262
+ // If the process hasn't exited in X seconds, kill it in the polite way
261
263
  /* c8 ignore next 10 */
262
- const res = await executeWithTimeout(exitPromise, 10000)
264
+ const res = await executeWithTimeout(exitPromise, exitTimeout)
263
265
  if (res === 'timeout') {
264
266
  this.subprocess.kill(this.subprocessTerminationSignal ?? 'SIGINT')
265
267
 
266
- // If the process hasn't exited in 10 seconds, kill it the hard way
267
- const res = await executeWithTimeout(exitPromise, 10000)
268
+ // If the process hasn't exited in X seconds, kill it the hard way
269
+ const res = await executeWithTimeout(exitPromise, exitTimeout)
268
270
  if (res === 'timeout') {
269
271
  this.subprocess.kill('SIGKILL')
270
272
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/basic",
3
- "version": "2.8.0-alpha.1",
3
+ "version": "2.8.0-alpha.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -23,11 +23,11 @@
23
23
  "split2": "^4.2.0",
24
24
  "undici": "^6.19.5",
25
25
  "ws": "^8.18.0",
26
- "@platformatic/config": "2.8.0-alpha.1",
27
- "@platformatic/itc": "2.8.0-alpha.1",
28
- "@platformatic/metrics": "2.8.0-alpha.1",
29
- "@platformatic/telemetry": "2.8.0-alpha.1",
30
- "@platformatic/utils": "2.8.0-alpha.1"
26
+ "@platformatic/config": "2.8.0-alpha.2",
27
+ "@platformatic/itc": "2.8.0-alpha.2",
28
+ "@platformatic/telemetry": "2.8.0-alpha.2",
29
+ "@platformatic/metrics": "2.8.0-alpha.2",
30
+ "@platformatic/utils": "2.8.0-alpha.2"
31
31
  },
32
32
  "devDependencies": {
33
33
  "borp": "^0.18.0",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.8.0-alpha.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.8.0-alpha.2.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Stackable",
5
5
  "type": "object",