@platformatic/runtime 3.1.0 → 3.2.1

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 (3) hide show
  1. package/lib/runtime.js +20 -21
  2. package/package.json +15 -15
  3. package/schema.json +1 -1
package/lib/runtime.js CHANGED
@@ -294,20 +294,24 @@ export class Runtime extends EventEmitter {
294
294
 
295
295
  const stopInvocations = []
296
296
 
297
- const allApplications = await this.getApplications(true)
298
-
299
297
  // Construct the reverse dependency graph
300
298
  const dependents = {}
301
- for (const application of allApplications.applications) {
302
- for (const dependency of application.dependencies ?? []) {
303
- let applicationDependents = dependents[dependency]
304
- if (!applicationDependents) {
305
- applicationDependents = new Set()
306
- dependents[dependency] = applicationDependents
307
- }
308
299
 
309
- applicationDependents.add(application.id)
300
+ try {
301
+ const allApplications = await this.getApplications(true)
302
+ for (const application of allApplications.applications) {
303
+ for (const dependency of application.dependencies ?? []) {
304
+ let applicationDependents = dependents[dependency]
305
+ if (!applicationDependents) {
306
+ applicationDependents = new Set()
307
+ dependents[dependency] = applicationDependents
308
+ }
309
+
310
+ applicationDependents.add(application.id)
311
+ }
310
312
  }
313
+ } catch (e) {
314
+ // Noop - This only happens if stop is invoked after a failed start, in which case we don't care about deps
311
315
  }
312
316
 
313
317
  for (const application of this.getApplicationsIds()) {
@@ -1606,17 +1610,12 @@ export class Runtime extends EventEmitter {
1606
1610
  if (enabled && config.restartOnError > 0) {
1607
1611
  // if gracePeriod is 0, it will be set to 1 to start health checks immediately
1608
1612
  // however, the health event will start when the worker is started
1609
- setTimeout(() => {
1610
- this.#setupHealthCheck(
1611
- config,
1612
- applicationConfig,
1613
- workersCount,
1614
- id,
1615
- index,
1616
- worker,
1617
- label
1618
- )
1619
- }, gracePeriod > 0 ? gracePeriod : 1).unref()
1613
+ setTimeout(
1614
+ () => {
1615
+ this.#setupHealthCheck(config, applicationConfig, workersCount, id, index, worker, label)
1616
+ },
1617
+ gracePeriod > 0 ? gracePeriod : 1
1618
+ ).unref()
1620
1619
  }
1621
1620
  } catch (err) {
1622
1621
  const error = ensureError(err)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/runtime",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -34,14 +34,14 @@
34
34
  "typescript": "^5.5.4",
35
35
  "undici-oidc-interceptor": "^0.5.0",
36
36
  "why-is-node-running": "^2.2.2",
37
- "@platformatic/composer": "3.1.0",
38
- "@platformatic/db": "3.1.0",
39
- "@platformatic/node": "3.1.0",
40
- "@platformatic/gateway": "3.1.0",
41
- "@platformatic/service": "3.1.0",
42
- "@platformatic/wattpm-pprof-capture": "3.1.0",
43
- "@platformatic/sql-graphql": "3.1.0",
44
- "@platformatic/sql-mapper": "3.1.0"
37
+ "@platformatic/composer": "3.2.1",
38
+ "@platformatic/db": "3.2.1",
39
+ "@platformatic/gateway": "3.2.1",
40
+ "@platformatic/node": "3.2.1",
41
+ "@platformatic/service": "3.2.1",
42
+ "@platformatic/sql-graphql": "3.2.1",
43
+ "@platformatic/sql-mapper": "3.2.1",
44
+ "@platformatic/wattpm-pprof-capture": "3.2.1"
45
45
  },
46
46
  "dependencies": {
47
47
  "@fastify/accepts": "^5.0.0",
@@ -71,12 +71,12 @@
71
71
  "undici": "^7.0.0",
72
72
  "undici-thread-interceptor": "^0.14.0",
73
73
  "ws": "^8.16.0",
74
- "@platformatic/basic": "3.1.0",
75
- "@platformatic/foundation": "3.1.0",
76
- "@platformatic/generators": "3.1.0",
77
- "@platformatic/itc": "3.1.0",
78
- "@platformatic/metrics": "3.1.0",
79
- "@platformatic/telemetry": "3.1.0"
74
+ "@platformatic/basic": "3.2.1",
75
+ "@platformatic/generators": "3.2.1",
76
+ "@platformatic/foundation": "3.2.1",
77
+ "@platformatic/itc": "3.2.1",
78
+ "@platformatic/telemetry": "3.2.1",
79
+ "@platformatic/metrics": "3.2.1"
80
80
  },
81
81
  "engines": {
82
82
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.1.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.2.1.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Runtime Config",
5
5
  "type": "object",