@platformatic/runtime 2.11.0 → 2.12.0

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/config.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
- export type HttpsSchemasPlatformaticDevPlatformaticRuntime2110Json = {
8
+ export type HttpsSchemasPlatformaticDevPlatformaticRuntime2120Json = {
9
9
  [k: string]: unknown;
10
10
  } & {
11
11
  $schema?: string;
@@ -164,6 +164,7 @@ export type HttpsSchemasPlatformaticDevPlatformaticRuntime2110Json = {
164
164
  watchDisabled?: boolean;
165
165
  [k: string]: unknown;
166
166
  };
167
+ serviceTimeout?: number | string;
167
168
  };
168
169
 
169
170
  export interface UndiciInterceptor {
package/lib/runtime.js CHANGED
@@ -79,7 +79,10 @@ class Runtime extends EventEmitter {
79
79
  this.#servicesIds = []
80
80
  this.#url = undefined
81
81
  // Note: nothing hits the main thread so there is no reason to set the globalDispatcher here
82
- this.#interceptor = createThreadInterceptor({ domain: '.plt.local', timeout: true })
82
+ this.#interceptor = createThreadInterceptor({
83
+ domain: '.plt.local',
84
+ timeout: this.#configManager.current.serviceTimeout
85
+ })
83
86
  this.#status = undefined
84
87
  this.#restartingWorkers = new Map()
85
88
  }
package/lib/schema.js CHANGED
@@ -274,6 +274,16 @@ const platformaticRuntimeSchema = {
274
274
  type: 'boolean'
275
275
  }
276
276
  }
277
+ },
278
+ serviceTimeout: {
279
+ anyOf: [
280
+ {
281
+ type: 'number',
282
+ minimum: 1
283
+ },
284
+ { type: 'string' }
285
+ ],
286
+ default: 300000 // 5 minutes
277
287
  }
278
288
  },
279
289
  anyOf: [{ required: ['autoload'] }, { required: ['services'] }, { required: ['web'] }],
package/lib/start.js CHANGED
@@ -31,7 +31,7 @@ async function restartRuntime (runtime) {
31
31
  async function buildRuntime (configManager, env) {
32
32
  env = env || process.env
33
33
 
34
- if (inspector.url()) {
34
+ if (inspector.url() && !env.VSCODE_INSPECTOR_OPTIONS) {
35
35
  throw new errors.NodeInspectorFlagsNotSupportedError()
36
36
  }
37
37
 
@@ -98,9 +98,7 @@ async function main () {
98
98
  setGlobalDispatcher(globalDispatcher)
99
99
 
100
100
  // Setup mesh networker
101
- // The timeout is set to 5 minutes to avoid long term memory leaks
102
- // TODO: make this configurable
103
- const threadDispatcher = wire({ port: parentPort, useNetwork: service.useHttp, timeout: 5 * 60 * 1000 })
101
+ const threadDispatcher = wire({ port: parentPort, useNetwork: service.useHttp, timeout: config.serviceTimeout })
104
102
 
105
103
  // If the service is an entrypoint and runtime server config is defined, use it.
106
104
  let serverConfig = null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/runtime",
3
- "version": "2.11.0",
3
+ "version": "2.12.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -35,12 +35,12 @@
35
35
  "typescript": "^5.5.4",
36
36
  "undici-oidc-interceptor": "^0.5.0",
37
37
  "why-is-node-running": "^2.2.2",
38
- "@platformatic/composer": "2.11.0",
39
- "@platformatic/db": "2.11.0",
40
- "@platformatic/service": "2.11.0",
41
- "@platformatic/node": "2.11.0",
42
- "@platformatic/sql-graphql": "2.11.0",
43
- "@platformatic/sql-mapper": "2.11.0"
38
+ "@platformatic/composer": "2.12.0",
39
+ "@platformatic/db": "2.12.0",
40
+ "@platformatic/service": "2.12.0",
41
+ "@platformatic/node": "2.12.0",
42
+ "@platformatic/sql-mapper": "2.12.0",
43
+ "@platformatic/sql-graphql": "2.12.0"
44
44
  },
45
45
  "dependencies": {
46
46
  "@fastify/error": "^4.0.0",
@@ -62,21 +62,21 @@
62
62
  "help-me": "^5.0.0",
63
63
  "minimist": "^1.2.8",
64
64
  "pino": "^8.19.0",
65
- "pino-pretty": "^12.0.0",
65
+ "pino-pretty": "^13.0.0",
66
66
  "pino-roll": "^2.0.0",
67
67
  "prom-client": "^15.1.2",
68
68
  "semgrator": "^0.3.0",
69
69
  "tail-file-stream": "^0.2.0",
70
70
  "undici": "^6.9.0",
71
- "undici-thread-interceptor": "^0.8.0",
71
+ "undici-thread-interceptor": "^0.9.0",
72
72
  "ws": "^8.16.0",
73
- "@platformatic/basic": "2.11.0",
74
- "@platformatic/config": "2.11.0",
75
- "@platformatic/itc": "2.11.0",
76
- "@platformatic/generators": "2.11.0",
77
- "@platformatic/telemetry": "2.11.0",
78
- "@platformatic/ts-compiler": "2.11.0",
79
- "@platformatic/utils": "2.11.0"
73
+ "@platformatic/basic": "2.12.0",
74
+ "@platformatic/config": "2.12.0",
75
+ "@platformatic/generators": "2.12.0",
76
+ "@platformatic/utils": "2.12.0",
77
+ "@platformatic/itc": "2.12.0",
78
+ "@platformatic/ts-compiler": "2.12.0",
79
+ "@platformatic/telemetry": "2.12.0"
80
80
  },
81
81
  "scripts": {
82
82
  "test": "npm run lint && borp --concurrency=1 --timeout=300000 && tsd",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/runtime/2.11.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/runtime/2.12.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "type": "object",
5
5
  "properties": {
@@ -1056,6 +1056,18 @@
1056
1056
  "type": "boolean"
1057
1057
  }
1058
1058
  }
1059
+ },
1060
+ "serviceTimeout": {
1061
+ "anyOf": [
1062
+ {
1063
+ "type": "number",
1064
+ "minimum": 1
1065
+ },
1066
+ {
1067
+ "type": "string"
1068
+ }
1069
+ ],
1070
+ "default": 300000
1059
1071
  }
1060
1072
  },
1061
1073
  "anyOf": [