@platformatic/runtime 2.44.4 → 2.45.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 +2 -1
- package/lib/config.js +1 -1
- package/lib/management-api.js +1 -1
- package/lib/prom-server.js +3 -0
- package/lib/runtime.js +118 -40
- package/lib/schema.js +10 -3
- package/lib/worker/itc.js +9 -5
- package/lib/worker/symbols.js +2 -0
- package/package.json +16 -15
- package/schema.json +11 -22
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
|
|
8
|
+
export type HttpsSchemasPlatformaticDevPlatformaticRuntime2450Json = {
|
|
9
9
|
[k: string]: unknown;
|
|
10
10
|
} & {
|
|
11
11
|
$schema?: string;
|
|
@@ -163,6 +163,7 @@ export type HttpsSchemasPlatformaticDevPlatformaticRuntime2444Json = {
|
|
|
163
163
|
| boolean
|
|
164
164
|
| {
|
|
165
165
|
port?: number | string;
|
|
166
|
+
enabled?: boolean | string;
|
|
166
167
|
hostname?: string;
|
|
167
168
|
endpoint?: string;
|
|
168
169
|
auth?: {
|
package/lib/config.js
CHANGED
|
@@ -70,7 +70,7 @@ async function _transformConfig (configManager, args) {
|
|
|
70
70
|
config = join(entryPath, configFilename)
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
const service = { id, config, path: entryPath, useHttp: !!mapping.useHttp }
|
|
73
|
+
const service = { id, config, path: entryPath, useHttp: !!mapping.useHttp, health: mapping.health }
|
|
74
74
|
const existingServiceId = services.findIndex(service => service.id === id)
|
|
75
75
|
|
|
76
76
|
if (existingServiceId !== -1) {
|
package/lib/management-api.js
CHANGED
package/lib/prom-server.js
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
const fastify = require('fastify')
|
|
4
4
|
|
|
5
5
|
async function startPrometheusServer (runtime, opts) {
|
|
6
|
+
if (opts.enabled === false) {
|
|
7
|
+
return
|
|
8
|
+
}
|
|
6
9
|
const host = opts.hostname ?? '0.0.0.0'
|
|
7
10
|
const port = opts.port ?? 9090
|
|
8
11
|
const metricsEndpoint = opts.endpoint ?? '/metrics'
|
package/lib/runtime.js
CHANGED
|
@@ -26,6 +26,7 @@ const { sendViaITC, waitEventFromITC } = require('./worker/itc')
|
|
|
26
26
|
const { RoundRobinMap } = require('./worker/round-robin-map.js')
|
|
27
27
|
const {
|
|
28
28
|
kId,
|
|
29
|
+
kFullId,
|
|
29
30
|
kServiceId,
|
|
30
31
|
kWorkerId,
|
|
31
32
|
kITC,
|
|
@@ -273,7 +274,7 @@ class Runtime extends EventEmitter {
|
|
|
273
274
|
if (this.#inspectorServer) {
|
|
274
275
|
await this.#inspectorServer.close()
|
|
275
276
|
}
|
|
276
|
-
|
|
277
|
+
await this.#meshInterceptor.close()
|
|
277
278
|
for (const service of this.#servicesIds) {
|
|
278
279
|
await this.stopService(service, silent)
|
|
279
280
|
}
|
|
@@ -285,6 +286,7 @@ class Runtime extends EventEmitter {
|
|
|
285
286
|
this.emit('restarting')
|
|
286
287
|
|
|
287
288
|
await this.stop()
|
|
289
|
+
this.#meshInterceptor.restart()
|
|
288
290
|
await this.start()
|
|
289
291
|
|
|
290
292
|
this.emit('restarted')
|
|
@@ -296,7 +298,7 @@ class Runtime extends EventEmitter {
|
|
|
296
298
|
return this.#status
|
|
297
299
|
}
|
|
298
300
|
|
|
299
|
-
async close (
|
|
301
|
+
async close (silent = false) {
|
|
300
302
|
this.#updateStatus('closing')
|
|
301
303
|
|
|
302
304
|
clearInterval(this.#metricsTimeout)
|
|
@@ -304,14 +306,10 @@ class Runtime extends EventEmitter {
|
|
|
304
306
|
await this.stop(silent)
|
|
305
307
|
|
|
306
308
|
if (this.#managementApi) {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
})
|
|
312
|
-
} else {
|
|
313
|
-
await this.#managementApi.close()
|
|
314
|
-
}
|
|
309
|
+
// This allow a close request coming from the management API to correctly be handled
|
|
310
|
+
setImmediate(() => {
|
|
311
|
+
this.#managementApi.close()
|
|
312
|
+
})
|
|
315
313
|
}
|
|
316
314
|
|
|
317
315
|
if (this.#prometheusServer) {
|
|
@@ -1006,7 +1004,7 @@ class Runtime extends EventEmitter {
|
|
|
1006
1004
|
this.emit('service:init', id)
|
|
1007
1005
|
}
|
|
1008
1006
|
|
|
1009
|
-
async #setupWorker (config, serviceConfig, workersCount, serviceId, index) {
|
|
1007
|
+
async #setupWorker (config, serviceConfig, workersCount, serviceId, index, enabled = true) {
|
|
1010
1008
|
const { restartOnError } = config
|
|
1011
1009
|
const workerId = `${serviceId}:${index}`
|
|
1012
1010
|
|
|
@@ -1096,7 +1094,7 @@ class Runtime extends EventEmitter {
|
|
|
1096
1094
|
worker[kWorkerStatus] = 'exited'
|
|
1097
1095
|
this.emit('service:worker:exited', eventPayload)
|
|
1098
1096
|
|
|
1099
|
-
this.#cleanupWorker(
|
|
1097
|
+
this.#cleanupWorker(worker)
|
|
1100
1098
|
|
|
1101
1099
|
if (this.#status === 'stopping') {
|
|
1102
1100
|
return
|
|
@@ -1130,8 +1128,10 @@ class Runtime extends EventEmitter {
|
|
|
1130
1128
|
})
|
|
1131
1129
|
|
|
1132
1130
|
worker[kId] = workersCount > 1 ? workerId : serviceId
|
|
1131
|
+
worker[kFullId] = workerId
|
|
1133
1132
|
worker[kServiceId] = serviceId
|
|
1134
1133
|
worker[kWorkerId] = workersCount > 1 ? index : undefined
|
|
1134
|
+
worker[kWorkerStatus] = 'init'
|
|
1135
1135
|
worker[kForwardEvents] = false
|
|
1136
1136
|
|
|
1137
1137
|
if (inspectorOptions) {
|
|
@@ -1190,19 +1190,21 @@ class Runtime extends EventEmitter {
|
|
|
1190
1190
|
})
|
|
1191
1191
|
}
|
|
1192
1192
|
|
|
1193
|
-
|
|
1194
|
-
|
|
1193
|
+
if (enabled) {
|
|
1194
|
+
// Store locally
|
|
1195
|
+
this.#workers.set(workerId, worker)
|
|
1195
1196
|
|
|
1196
|
-
|
|
1197
|
-
this.#
|
|
1197
|
+
// Setup the interceptor
|
|
1198
|
+
this.#meshInterceptor.route(serviceId, worker)
|
|
1198
1199
|
}
|
|
1199
1200
|
|
|
1200
|
-
// Setup the interceptor
|
|
1201
|
-
this.#meshInterceptor.route(serviceId, worker)
|
|
1202
|
-
|
|
1203
1201
|
// Store dependencies
|
|
1204
1202
|
const [{ dependencies }] = await waitEventFromITC(worker, 'init')
|
|
1205
1203
|
|
|
1204
|
+
if (serviceConfig.entrypoint) {
|
|
1205
|
+
this.#entrypointId = serviceId
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1206
1208
|
serviceConfig.dependencies = dependencies
|
|
1207
1209
|
for (const { envVar, url } of dependencies) {
|
|
1208
1210
|
if (envVar) {
|
|
@@ -1214,9 +1216,11 @@ class Runtime extends EventEmitter {
|
|
|
1214
1216
|
worker[kConfig] = { ...serviceConfig, health }
|
|
1215
1217
|
worker[kWorkerStatus] = 'boot'
|
|
1216
1218
|
this.emit('service:worker:boot', eventPayload)
|
|
1219
|
+
|
|
1220
|
+
return worker
|
|
1217
1221
|
}
|
|
1218
1222
|
|
|
1219
|
-
#setupHealthCheck (worker, errorLabel) {
|
|
1223
|
+
#setupHealthCheck (config, serviceConfig, workersCount, id, index, workerId, worker, errorLabel) {
|
|
1220
1224
|
// Clear the timeout when exiting
|
|
1221
1225
|
worker.on('exit', () => clearTimeout(worker[kHealthCheckTimer]))
|
|
1222
1226
|
|
|
@@ -1229,9 +1233,10 @@ class Runtime extends EventEmitter {
|
|
|
1229
1233
|
const memoryUsage = heapUsed / maxHeapTotal
|
|
1230
1234
|
const unhealthy = elu > maxELU || memoryUsage > maxHeapUsed
|
|
1231
1235
|
|
|
1236
|
+
const serviceId = worker[kServiceId]
|
|
1232
1237
|
this.emit('health', {
|
|
1233
1238
|
id: worker[kId],
|
|
1234
|
-
service:
|
|
1239
|
+
service: serviceId,
|
|
1235
1240
|
worker: worker[kWorkerId],
|
|
1236
1241
|
currentHealth: health,
|
|
1237
1242
|
unhealthy,
|
|
@@ -1256,20 +1261,39 @@ class Runtime extends EventEmitter {
|
|
|
1256
1261
|
unhealthyChecks = 0
|
|
1257
1262
|
}
|
|
1258
1263
|
|
|
1259
|
-
if (unhealthyChecks
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
return
|
|
1266
|
-
}
|
|
1264
|
+
if (unhealthyChecks === maxUnhealthyChecks) {
|
|
1265
|
+
try {
|
|
1266
|
+
this.logger.error(
|
|
1267
|
+
{ elu, maxELU, memoryUsage, maxMemoryUsage: maxHeapUsed },
|
|
1268
|
+
`The ${errorLabel} is unhealthy. Replacing it ...`
|
|
1269
|
+
)
|
|
1267
1270
|
|
|
1268
|
-
|
|
1271
|
+
await this.#replaceWorker(config, serviceConfig, workersCount, id, index, workerId, worker)
|
|
1272
|
+
} catch (e) {
|
|
1273
|
+
this.logger.error(
|
|
1274
|
+
{ elu, maxELU, memoryUsage, maxMemoryUsage: maxHeapUsed },
|
|
1275
|
+
`Cannot replace the ${errorLabel}. Forcefully terminating it ...`
|
|
1276
|
+
)
|
|
1277
|
+
|
|
1278
|
+
worker.terminate()
|
|
1279
|
+
}
|
|
1280
|
+
} else {
|
|
1281
|
+
worker[kHealthCheckTimer].refresh()
|
|
1282
|
+
}
|
|
1269
1283
|
}, interval)
|
|
1270
1284
|
}
|
|
1271
1285
|
|
|
1272
|
-
async #startWorker (
|
|
1286
|
+
async #startWorker (
|
|
1287
|
+
config,
|
|
1288
|
+
serviceConfig,
|
|
1289
|
+
workersCount,
|
|
1290
|
+
id,
|
|
1291
|
+
index,
|
|
1292
|
+
silent,
|
|
1293
|
+
bootstrapAttempt = 0,
|
|
1294
|
+
worker = undefined,
|
|
1295
|
+
disableRestartAttempts = false
|
|
1296
|
+
) {
|
|
1273
1297
|
const workerId = `${id}:${index}`
|
|
1274
1298
|
const label = this.#workerExtendedLabel(id, index, workersCount)
|
|
1275
1299
|
|
|
@@ -1277,7 +1301,10 @@ class Runtime extends EventEmitter {
|
|
|
1277
1301
|
this.logger?.info(`Starting the ${label}...`)
|
|
1278
1302
|
}
|
|
1279
1303
|
|
|
1280
|
-
|
|
1304
|
+
if (!worker) {
|
|
1305
|
+
worker = await this.#getWorkerById(id, index, false, false)
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1281
1308
|
const eventPayload = { service: id, worker: index, workersCount }
|
|
1282
1309
|
|
|
1283
1310
|
// The service was stopped, recreate the thread
|
|
@@ -1321,7 +1348,7 @@ class Runtime extends EventEmitter {
|
|
|
1321
1348
|
if (enabled && config.restartOnError > 0) {
|
|
1322
1349
|
worker[kHealthCheckTimer] = setTimeout(
|
|
1323
1350
|
() => {
|
|
1324
|
-
this.#setupHealthCheck(worker, label)
|
|
1351
|
+
this.#setupHealthCheck(config, serviceConfig, workersCount, id, index, workerId, worker, label)
|
|
1325
1352
|
},
|
|
1326
1353
|
gracePeriod > 0 ? gracePeriod : 1
|
|
1327
1354
|
)
|
|
@@ -1330,7 +1357,7 @@ class Runtime extends EventEmitter {
|
|
|
1330
1357
|
// TODO: handle port allocation error here
|
|
1331
1358
|
if (error.code === 'EADDRINUSE') throw error
|
|
1332
1359
|
|
|
1333
|
-
this.#cleanupWorker(
|
|
1360
|
+
this.#cleanupWorker(worker)
|
|
1334
1361
|
|
|
1335
1362
|
if (worker[kWorkerStatus] !== 'exited') {
|
|
1336
1363
|
// This prevent the exit handler to restart service
|
|
@@ -1346,7 +1373,7 @@ class Runtime extends EventEmitter {
|
|
|
1346
1373
|
|
|
1347
1374
|
const restartOnError = config.restartOnError
|
|
1348
1375
|
|
|
1349
|
-
if (!restartOnError) {
|
|
1376
|
+
if (disableRestartAttempts || !restartOnError) {
|
|
1350
1377
|
throw error
|
|
1351
1378
|
}
|
|
1352
1379
|
|
|
@@ -1369,13 +1396,20 @@ class Runtime extends EventEmitter {
|
|
|
1369
1396
|
}
|
|
1370
1397
|
}
|
|
1371
1398
|
|
|
1372
|
-
async #stopWorker (workersCount, id, index, silent) {
|
|
1373
|
-
|
|
1399
|
+
async #stopWorker (workersCount, id, index, silent, worker = undefined) {
|
|
1400
|
+
if (!worker) {
|
|
1401
|
+
worker = await this.#getWorkerById(id, index, false, false)
|
|
1402
|
+
}
|
|
1374
1403
|
|
|
1375
1404
|
if (!worker) {
|
|
1376
1405
|
return
|
|
1377
1406
|
}
|
|
1378
1407
|
|
|
1408
|
+
// Starting should be aborted, discard the worker
|
|
1409
|
+
if (worker[kWorkerStatus] !== 'started') {
|
|
1410
|
+
return this.#discardWorker(worker)
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1379
1413
|
const eventPayload = { service: id, worker: index, workersCount }
|
|
1380
1414
|
|
|
1381
1415
|
worker[kWorkerStatus] = 'stopping'
|
|
@@ -1419,12 +1453,23 @@ class Runtime extends EventEmitter {
|
|
|
1419
1453
|
this.emit('service:worker:stopped', eventPayload)
|
|
1420
1454
|
}
|
|
1421
1455
|
|
|
1422
|
-
#cleanupWorker (
|
|
1423
|
-
|
|
1456
|
+
#cleanupWorker (worker) {
|
|
1457
|
+
clearTimeout(worker[kHealthCheckTimer])
|
|
1458
|
+
|
|
1459
|
+
const currentWorker = this.#workers.get(worker[kFullId])
|
|
1460
|
+
|
|
1461
|
+
if (currentWorker === worker) {
|
|
1462
|
+
this.#workers.delete(worker[kFullId])
|
|
1463
|
+
}
|
|
1424
1464
|
|
|
1425
1465
|
worker[kITC].close()
|
|
1466
|
+
}
|
|
1426
1467
|
|
|
1427
|
-
|
|
1468
|
+
async #discardWorker (worker) {
|
|
1469
|
+
worker.removeAllListeners('exit')
|
|
1470
|
+
await worker.terminate()
|
|
1471
|
+
|
|
1472
|
+
return this.#cleanupWorker(worker)
|
|
1428
1473
|
}
|
|
1429
1474
|
|
|
1430
1475
|
#workerExtendedLabel (serviceId, workerId, workersCount) {
|
|
@@ -1476,6 +1521,39 @@ class Runtime extends EventEmitter {
|
|
|
1476
1521
|
await restartPromise
|
|
1477
1522
|
}
|
|
1478
1523
|
|
|
1524
|
+
async #replaceWorker (config, serviceConfig, workersCount, serviceId, index, workerId, worker) {
|
|
1525
|
+
let newWorker
|
|
1526
|
+
|
|
1527
|
+
try {
|
|
1528
|
+
// Create a new worker
|
|
1529
|
+
newWorker = await this.#setupWorker(config, serviceConfig, workersCount, serviceId, index, false)
|
|
1530
|
+
|
|
1531
|
+
// Make sure the runtime hasn't been stopped in the meanwhile
|
|
1532
|
+
if (this.#status !== 'started') {
|
|
1533
|
+
return this.#discardWorker(newWorker)
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
// Add the worker to the mesh
|
|
1537
|
+
await this.#startWorker(config, serviceConfig, workersCount, serviceId, index, false, 0, newWorker, true)
|
|
1538
|
+
|
|
1539
|
+
// Make sure the runtime hasn't been stopped in the meanwhile
|
|
1540
|
+
if (this.#status !== 'started') {
|
|
1541
|
+
return this.#discardWorker(newWorker)
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
this.#workers.set(workerId, newWorker)
|
|
1545
|
+
this.#meshInterceptor.route(serviceId, newWorker)
|
|
1546
|
+
|
|
1547
|
+
// Remove the old worker and then kill it
|
|
1548
|
+
await sendViaITC(worker, 'removeFromMesh')
|
|
1549
|
+
} catch (e) {
|
|
1550
|
+
newWorker?.terminate?.()
|
|
1551
|
+
throw e
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
await this.#stopWorker(workersCount, serviceId, index, false, worker)
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1479
1557
|
async #getServiceById (serviceId, ensureStarted = false, mustExist = true) {
|
|
1480
1558
|
// If the serviceId includes the worker, properly split
|
|
1481
1559
|
let workerId
|
package/lib/schema.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
const telemetry = require('@platformatic/telemetry').schema
|
|
5
5
|
const {
|
|
6
|
-
schemaComponents: { server, logger, health }
|
|
6
|
+
schemaComponents: { server, logger, health, healthWithoutDefaults }
|
|
7
7
|
} = require('@platformatic/utils')
|
|
8
8
|
|
|
9
9
|
const env = {
|
|
@@ -65,7 +65,7 @@ const services = {
|
|
|
65
65
|
type: 'boolean'
|
|
66
66
|
},
|
|
67
67
|
workers,
|
|
68
|
-
health: { ...
|
|
68
|
+
health: { ...healthWithoutDefaults, default: undefined },
|
|
69
69
|
arguments: {
|
|
70
70
|
type: 'array',
|
|
71
71
|
items: {
|
|
@@ -174,7 +174,7 @@ const platformaticRuntimeSchema = {
|
|
|
174
174
|
type: 'boolean'
|
|
175
175
|
},
|
|
176
176
|
workers,
|
|
177
|
-
health: { ...
|
|
177
|
+
health: { ...healthWithoutDefaults, default: undefined },
|
|
178
178
|
preload,
|
|
179
179
|
arguments: {
|
|
180
180
|
type: 'array',
|
|
@@ -359,6 +359,13 @@ const platformaticRuntimeSchema = {
|
|
|
359
359
|
port: {
|
|
360
360
|
anyOf: [{ type: 'integer' }, { type: 'string' }]
|
|
361
361
|
},
|
|
362
|
+
enabled: {
|
|
363
|
+
anyOf: [{
|
|
364
|
+
type: 'boolean'
|
|
365
|
+
}, {
|
|
366
|
+
type: 'string'
|
|
367
|
+
}]
|
|
368
|
+
},
|
|
362
369
|
hostname: { type: 'string' },
|
|
363
370
|
endpoint: { type: 'string' },
|
|
364
371
|
auth: {
|
package/lib/worker/itc.js
CHANGED
|
@@ -93,7 +93,7 @@ function setupITC (app, service, dispatcher) {
|
|
|
93
93
|
await app.stop()
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
dispatcher.interceptor.close()
|
|
96
|
+
await dispatcher.interceptor.close()
|
|
97
97
|
itc.close()
|
|
98
98
|
},
|
|
99
99
|
|
|
@@ -101,6 +101,14 @@ function setupITC (app, service, dispatcher) {
|
|
|
101
101
|
return app.stackable.build()
|
|
102
102
|
},
|
|
103
103
|
|
|
104
|
+
async removeFromMesh () {
|
|
105
|
+
return dispatcher.interceptor.close()
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
inject (injectParams) {
|
|
109
|
+
return app.stackable.inject(injectParams)
|
|
110
|
+
},
|
|
111
|
+
|
|
104
112
|
getStatus () {
|
|
105
113
|
return app.getStatus()
|
|
106
114
|
},
|
|
@@ -158,10 +166,6 @@ function setupITC (app, service, dispatcher) {
|
|
|
158
166
|
} catch (err) {
|
|
159
167
|
throw new errors.FailedToRetrieveHealthError(service.id, err.message)
|
|
160
168
|
}
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
inject (injectParams) {
|
|
164
|
-
return app.stackable.inject(injectParams)
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
})
|
package/lib/worker/symbols.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const kConfig = Symbol.for('plt.runtime.config')
|
|
4
4
|
const kId = Symbol.for('plt.runtime.id') // This is also used to detect if we are running in a Platformatic runtime thread
|
|
5
|
+
const kFullId = Symbol.for('plt.runtime.fullId')
|
|
5
6
|
const kServiceId = Symbol.for('plt.runtime.service.id')
|
|
6
7
|
const kWorkerId = Symbol.for('plt.runtime.worker.id')
|
|
7
8
|
const kITC = Symbol.for('plt.runtime.itc')
|
|
@@ -14,6 +15,7 @@ const kStderrMarker = '\ue002'
|
|
|
14
15
|
module.exports = {
|
|
15
16
|
kConfig,
|
|
16
17
|
kId,
|
|
18
|
+
kFullId,
|
|
17
19
|
kServiceId,
|
|
18
20
|
kWorkerId,
|
|
19
21
|
kITC,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/runtime",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.45.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"@fastify/compress": "^8.0.0",
|
|
21
21
|
"@fastify/express": "^4.0.0",
|
|
22
22
|
"@fastify/formbody": "^8.0.0",
|
|
23
|
+
"autocannon": "^8.0.0",
|
|
23
24
|
"borp": "^0.19.0",
|
|
24
25
|
"c8": "^10.0.0",
|
|
25
26
|
"eslint": "9",
|
|
@@ -36,12 +37,12 @@
|
|
|
36
37
|
"typescript": "^5.5.4",
|
|
37
38
|
"undici-oidc-interceptor": "^0.5.0",
|
|
38
39
|
"why-is-node-running": "^2.2.2",
|
|
39
|
-
"@platformatic/composer": "2.
|
|
40
|
-
"@platformatic/db": "2.
|
|
41
|
-
"@platformatic/
|
|
42
|
-
"@platformatic/
|
|
43
|
-
"@platformatic/sql-graphql": "2.
|
|
44
|
-
"@platformatic/sql-mapper": "2.
|
|
40
|
+
"@platformatic/composer": "2.45.0",
|
|
41
|
+
"@platformatic/db": "2.45.0",
|
|
42
|
+
"@platformatic/service": "2.45.0",
|
|
43
|
+
"@platformatic/node": "2.45.0",
|
|
44
|
+
"@platformatic/sql-graphql": "2.45.0",
|
|
45
|
+
"@platformatic/sql-mapper": "2.45.0"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
47
48
|
"@fastify/accepts": "^5.0.0",
|
|
@@ -73,15 +74,15 @@
|
|
|
73
74
|
"tail-file-stream": "^0.2.0",
|
|
74
75
|
"thread-cpu-usage": "^0.2.0",
|
|
75
76
|
"undici": "^7.0.0",
|
|
76
|
-
"undici-thread-interceptor": "^0.
|
|
77
|
+
"undici-thread-interceptor": "^0.12.2",
|
|
77
78
|
"ws": "^8.16.0",
|
|
78
|
-
"@platformatic/basic": "2.
|
|
79
|
-
"@platformatic/
|
|
80
|
-
"@platformatic/
|
|
81
|
-
"@platformatic/itc": "2.
|
|
82
|
-
"@platformatic/
|
|
83
|
-
"@platformatic/
|
|
84
|
-
"@platformatic/utils": "2.
|
|
79
|
+
"@platformatic/basic": "2.45.0",
|
|
80
|
+
"@platformatic/generators": "2.45.0",
|
|
81
|
+
"@platformatic/config": "2.45.0",
|
|
82
|
+
"@platformatic/itc": "2.45.0",
|
|
83
|
+
"@platformatic/ts-compiler": "2.45.0",
|
|
84
|
+
"@platformatic/telemetry": "2.45.0",
|
|
85
|
+
"@platformatic/utils": "2.45.0"
|
|
85
86
|
},
|
|
86
87
|
"scripts": {
|
|
87
88
|
"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.
|
|
2
|
+
"$id": "https://schemas.platformatic.dev/@platformatic/runtime/2.45.0.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -78,7 +78,6 @@
|
|
|
78
78
|
"type": "object",
|
|
79
79
|
"properties": {
|
|
80
80
|
"enabled": {
|
|
81
|
-
"default": true,
|
|
82
81
|
"anyOf": [
|
|
83
82
|
{
|
|
84
83
|
"type": "boolean"
|
|
@@ -89,7 +88,6 @@
|
|
|
89
88
|
]
|
|
90
89
|
},
|
|
91
90
|
"interval": {
|
|
92
|
-
"default": 30000,
|
|
93
91
|
"anyOf": [
|
|
94
92
|
{
|
|
95
93
|
"type": "number",
|
|
@@ -101,7 +99,6 @@
|
|
|
101
99
|
]
|
|
102
100
|
},
|
|
103
101
|
"gracePeriod": {
|
|
104
|
-
"default": 30000,
|
|
105
102
|
"anyOf": [
|
|
106
103
|
{
|
|
107
104
|
"type": "number",
|
|
@@ -113,7 +110,6 @@
|
|
|
113
110
|
]
|
|
114
111
|
},
|
|
115
112
|
"maxUnhealthyChecks": {
|
|
116
|
-
"default": 10,
|
|
117
113
|
"anyOf": [
|
|
118
114
|
{
|
|
119
115
|
"type": "number",
|
|
@@ -125,7 +121,6 @@
|
|
|
125
121
|
]
|
|
126
122
|
},
|
|
127
123
|
"maxELU": {
|
|
128
|
-
"default": 0.99,
|
|
129
124
|
"anyOf": [
|
|
130
125
|
{
|
|
131
126
|
"type": "number",
|
|
@@ -138,7 +133,6 @@
|
|
|
138
133
|
]
|
|
139
134
|
},
|
|
140
135
|
"maxHeapUsed": {
|
|
141
|
-
"default": 0.99,
|
|
142
136
|
"anyOf": [
|
|
143
137
|
{
|
|
144
138
|
"type": "number",
|
|
@@ -151,7 +145,6 @@
|
|
|
151
145
|
]
|
|
152
146
|
},
|
|
153
147
|
"maxHeapTotal": {
|
|
154
|
-
"default": 4294967296,
|
|
155
148
|
"anyOf": [
|
|
156
149
|
{
|
|
157
150
|
"type": "number",
|
|
@@ -249,7 +242,6 @@
|
|
|
249
242
|
"type": "object",
|
|
250
243
|
"properties": {
|
|
251
244
|
"enabled": {
|
|
252
|
-
"default": true,
|
|
253
245
|
"anyOf": [
|
|
254
246
|
{
|
|
255
247
|
"type": "boolean"
|
|
@@ -260,7 +252,6 @@
|
|
|
260
252
|
]
|
|
261
253
|
},
|
|
262
254
|
"interval": {
|
|
263
|
-
"default": 30000,
|
|
264
255
|
"anyOf": [
|
|
265
256
|
{
|
|
266
257
|
"type": "number",
|
|
@@ -272,7 +263,6 @@
|
|
|
272
263
|
]
|
|
273
264
|
},
|
|
274
265
|
"gracePeriod": {
|
|
275
|
-
"default": 30000,
|
|
276
266
|
"anyOf": [
|
|
277
267
|
{
|
|
278
268
|
"type": "number",
|
|
@@ -284,7 +274,6 @@
|
|
|
284
274
|
]
|
|
285
275
|
},
|
|
286
276
|
"maxUnhealthyChecks": {
|
|
287
|
-
"default": 10,
|
|
288
277
|
"anyOf": [
|
|
289
278
|
{
|
|
290
279
|
"type": "number",
|
|
@@ -296,7 +285,6 @@
|
|
|
296
285
|
]
|
|
297
286
|
},
|
|
298
287
|
"maxELU": {
|
|
299
|
-
"default": 0.99,
|
|
300
288
|
"anyOf": [
|
|
301
289
|
{
|
|
302
290
|
"type": "number",
|
|
@@ -309,7 +297,6 @@
|
|
|
309
297
|
]
|
|
310
298
|
},
|
|
311
299
|
"maxHeapUsed": {
|
|
312
|
-
"default": 0.99,
|
|
313
300
|
"anyOf": [
|
|
314
301
|
{
|
|
315
302
|
"type": "number",
|
|
@@ -322,7 +309,6 @@
|
|
|
322
309
|
]
|
|
323
310
|
},
|
|
324
311
|
"maxHeapTotal": {
|
|
325
|
-
"default": 4294967296,
|
|
326
312
|
"anyOf": [
|
|
327
313
|
{
|
|
328
314
|
"type": "number",
|
|
@@ -485,7 +471,6 @@
|
|
|
485
471
|
"type": "object",
|
|
486
472
|
"properties": {
|
|
487
473
|
"enabled": {
|
|
488
|
-
"default": true,
|
|
489
474
|
"anyOf": [
|
|
490
475
|
{
|
|
491
476
|
"type": "boolean"
|
|
@@ -496,7 +481,6 @@
|
|
|
496
481
|
]
|
|
497
482
|
},
|
|
498
483
|
"interval": {
|
|
499
|
-
"default": 30000,
|
|
500
484
|
"anyOf": [
|
|
501
485
|
{
|
|
502
486
|
"type": "number",
|
|
@@ -508,7 +492,6 @@
|
|
|
508
492
|
]
|
|
509
493
|
},
|
|
510
494
|
"gracePeriod": {
|
|
511
|
-
"default": 30000,
|
|
512
495
|
"anyOf": [
|
|
513
496
|
{
|
|
514
497
|
"type": "number",
|
|
@@ -520,7 +503,6 @@
|
|
|
520
503
|
]
|
|
521
504
|
},
|
|
522
505
|
"maxUnhealthyChecks": {
|
|
523
|
-
"default": 10,
|
|
524
506
|
"anyOf": [
|
|
525
507
|
{
|
|
526
508
|
"type": "number",
|
|
@@ -532,7 +514,6 @@
|
|
|
532
514
|
]
|
|
533
515
|
},
|
|
534
516
|
"maxELU": {
|
|
535
|
-
"default": 0.99,
|
|
536
517
|
"anyOf": [
|
|
537
518
|
{
|
|
538
519
|
"type": "number",
|
|
@@ -545,7 +526,6 @@
|
|
|
545
526
|
]
|
|
546
527
|
},
|
|
547
528
|
"maxHeapUsed": {
|
|
548
|
-
"default": 0.99,
|
|
549
529
|
"anyOf": [
|
|
550
530
|
{
|
|
551
531
|
"type": "number",
|
|
@@ -558,7 +538,6 @@
|
|
|
558
538
|
]
|
|
559
539
|
},
|
|
560
540
|
"maxHeapTotal": {
|
|
561
|
-
"default": 4294967296,
|
|
562
541
|
"anyOf": [
|
|
563
542
|
{
|
|
564
543
|
"type": "number",
|
|
@@ -1137,6 +1116,16 @@
|
|
|
1137
1116
|
}
|
|
1138
1117
|
]
|
|
1139
1118
|
},
|
|
1119
|
+
"enabled": {
|
|
1120
|
+
"anyOf": [
|
|
1121
|
+
{
|
|
1122
|
+
"type": "boolean"
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
"type": "string"
|
|
1126
|
+
}
|
|
1127
|
+
]
|
|
1128
|
+
},
|
|
1140
1129
|
"hostname": {
|
|
1141
1130
|
"type": "string"
|
|
1142
1131
|
},
|