@platformatic/basic 2.48.0 → 2.50.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 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.48.0",
3
+ "version": "2.50.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/config": "2.48.0",
28
- "@platformatic/itc": "2.48.0",
29
- "@platformatic/telemetry": "2.48.0",
30
- "@platformatic/metrics": "2.48.0",
31
- "@platformatic/utils": "2.48.0"
27
+ "@platformatic/config": "2.50.0",
28
+ "@platformatic/metrics": "2.50.0",
29
+ "@platformatic/telemetry": "2.50.0",
30
+ "@platformatic/utils": "2.50.0",
31
+ "@platformatic/itc": "2.50.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "borp": "^0.19.0",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.48.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.50.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Stackable",
5
5
  "type": "object",