@platformatic/service 3.14.0 → 3.15.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
@@ -410,6 +410,7 @@ export interface PlatformaticServiceConfig {
410
410
  rejectUnauthorized?: boolean;
411
411
  };
412
412
  };
413
+ reuseTcpPorts?: boolean;
413
414
  startTimeout?: number;
414
415
  restartOnError?: boolean | number;
415
416
  exitOnUnhandledErrors?: boolean;
package/lib/capability.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BaseCapability, cleanBasePath, ensureTrailingSlash, getServerUrl } from '@platformatic/basic'
2
- import { buildPinoFormatters, buildPinoTimestamp, deepmerge, features, isKeyEnabled } from '@platformatic/foundation'
2
+ import { buildPinoFormatters, buildPinoTimestamp, deepmerge, isKeyEnabled } from '@platformatic/foundation'
3
3
  import { telemetry } from '@platformatic/telemetry'
4
4
  import fastify from 'fastify'
5
5
  import { printSchema } from 'graphql'
@@ -69,6 +69,8 @@ export class ServiceCapability extends BaseCapability {
69
69
  return this.url
70
70
  }
71
71
 
72
+ await super._start()
73
+
72
74
  // Create the application if needed
73
75
  if (!this.#app) {
74
76
  await this.init()
@@ -264,10 +266,6 @@ export class ServiceCapability extends BaseCapability {
264
266
  const serverOptions = this.serverConfig
265
267
  const listenOptions = { host: serverOptions?.hostname || '127.0.0.1', port: serverOptions?.port || 0 }
266
268
 
267
- if (this.isProduction && features.node.reusePort) {
268
- listenOptions.reusePort = true
269
- }
270
-
271
269
  await this.#app.listen(listenOptions)
272
270
  this.url = getServerUrl(this.#app.server)
273
271
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/service",
3
- "version": "3.14.0",
3
+ "version": "3.15.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -67,12 +67,12 @@
67
67
  "rfdc": "^1.3.1",
68
68
  "semgrator": "^0.3.0",
69
69
  "undici": "^7.0.0",
70
- "@platformatic/basic": "3.14.0",
71
- "@platformatic/foundation": "3.14.0",
72
- "@platformatic/generators": "3.14.0",
73
- "@platformatic/metrics": "3.14.0",
74
- "@platformatic/telemetry": "3.14.0",
75
- "@platformatic/scalar-theme": "3.14.0"
70
+ "@platformatic/basic": "3.15.0",
71
+ "@platformatic/generators": "3.15.0",
72
+ "@platformatic/scalar-theme": "3.15.0",
73
+ "@platformatic/metrics": "3.15.0",
74
+ "@platformatic/telemetry": "3.15.0",
75
+ "@platformatic/foundation": "3.15.0"
76
76
  },
77
77
  "engines": {
78
78
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/service/3.14.0.json",
3
- "version": "3.14.0",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/service/3.15.0.json",
3
+ "version": "3.15.0",
4
4
  "title": "Platformatic Service Config",
5
5
  "type": "object",
6
6
  "properties": {
@@ -1054,6 +1054,10 @@
1054
1054
  "useHttp": {
1055
1055
  "type": "boolean"
1056
1056
  },
1057
+ "reuseTcpPorts": {
1058
+ "type": "boolean",
1059
+ "default": true
1060
+ },
1057
1061
  "workers": {
1058
1062
  "anyOf": [
1059
1063
  {
@@ -1620,6 +1624,10 @@
1620
1624
  },
1621
1625
  "additionalProperties": false
1622
1626
  },
1627
+ "reuseTcpPorts": {
1628
+ "type": "boolean",
1629
+ "default": true
1630
+ },
1623
1631
  "startTimeout": {
1624
1632
  "default": 30000,
1625
1633
  "type": "number",