@platformatic/basic 2.49.0 → 2.51.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/lib/base.js +14 -1
- package/package.json +6 -6
- package/schema.json +1 -1
package/lib/base.js
CHANGED
|
@@ -40,6 +40,7 @@ export class BaseStackable {
|
|
|
40
40
|
this.isProduction = options.context.isProduction
|
|
41
41
|
this.metricsRegistry = new client.Registry()
|
|
42
42
|
this.#metricsCollected = false
|
|
43
|
+
this.customHealthCheck = null
|
|
43
44
|
this.startHttpTimer = null
|
|
44
45
|
this.endHttpTimer = null
|
|
45
46
|
this.clientWs = null
|
|
@@ -75,7 +76,8 @@ export class BaseStackable {
|
|
|
75
76
|
setBasePath: this.setBasePath.bind(this),
|
|
76
77
|
runtimeBasePath: this.runtimeConfig?.basePath ?? null,
|
|
77
78
|
invalidateHttpCache: this.#invalidateHttpCache.bind(this),
|
|
78
|
-
prometheus: { client, registry: this.metricsRegistry }
|
|
79
|
+
prometheus: { client, registry: this.metricsRegistry },
|
|
80
|
+
setCustomHealthCheck: this.setCustomHealthCheck.bind(this),
|
|
79
81
|
})
|
|
80
82
|
}
|
|
81
83
|
|
|
@@ -136,6 +138,17 @@ export class BaseStackable {
|
|
|
136
138
|
this.graphqlSchema = schema
|
|
137
139
|
}
|
|
138
140
|
|
|
141
|
+
setCustomHealthCheck (fn) {
|
|
142
|
+
this.customHealthCheck = fn
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async getCustomHealthCheck () {
|
|
146
|
+
if (!this.customHealthCheck) {
|
|
147
|
+
return true
|
|
148
|
+
}
|
|
149
|
+
return await this.customHealthCheck()
|
|
150
|
+
}
|
|
151
|
+
|
|
139
152
|
setConnectionString (connectionString) {
|
|
140
153
|
this.connectionString = connectionString
|
|
141
154
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/basic",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.51.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"split2": "^4.2.0",
|
|
25
25
|
"undici": "^7.0.0",
|
|
26
26
|
"ws": "^8.18.0",
|
|
27
|
-
"@platformatic/
|
|
28
|
-
"@platformatic/
|
|
29
|
-
"@platformatic/metrics": "2.
|
|
30
|
-
"@platformatic/telemetry": "2.
|
|
31
|
-
"@platformatic/utils": "2.
|
|
27
|
+
"@platformatic/itc": "2.51.0",
|
|
28
|
+
"@platformatic/config": "2.51.0",
|
|
29
|
+
"@platformatic/metrics": "2.51.0",
|
|
30
|
+
"@platformatic/telemetry": "2.51.0",
|
|
31
|
+
"@platformatic/utils": "2.51.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"borp": "^0.19.0",
|
package/schema.json
CHANGED