@platformatic/service 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/stackable.js CHANGED
@@ -31,6 +31,8 @@ class ServiceStackable {
31
31
 
32
32
  this.runtimeConfig = deepmerge(this.context.runtimeConfig ?? {}, workerData?.config ?? {})
33
33
 
34
+ this.customHealthCheck = null
35
+
34
36
  this.configManager.on('error', err => {
35
37
  /* c8 ignore next */
36
38
  this.stackable.log({
@@ -53,7 +55,8 @@ class ServiceStackable {
53
55
  setBasePath: this.setBasePath.bind(this),
54
56
  runtimeBasePath: this.runtimeConfig?.basePath ?? null,
55
57
  invalidateHttpCache: this.#invalidateHttpCache.bind(this),
56
- prometheus: { client, registry: this.metricsRegistry }
58
+ prometheus: { client, registry: this.metricsRegistry },
59
+ setCustomHealthCheck: this.setCustomHealthCheck.bind(this)
57
60
  })
58
61
  }
59
62
 
@@ -176,6 +179,17 @@ class ServiceStackable {
176
179
  return this.app.graphql ? printSchema(this.app.graphql.schema) : null
177
180
  }
178
181
 
182
+ setCustomHealthCheck (fn) {
183
+ this.customHealthCheck = fn
184
+ }
185
+
186
+ async getCustomHealthCheck () {
187
+ if (!this.customHealthCheck) {
188
+ return true
189
+ }
190
+ return await this.customHealthCheck()
191
+ }
192
+
179
193
  // This method is not a part of Stackable interface because we need to register
180
194
  // fastify metrics before the server is started.
181
195
  async #collectMetrics () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/service",
3
- "version": "2.48.0",
3
+ "version": "2.50.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -77,14 +77,14 @@
77
77
  "rfdc": "^1.3.1",
78
78
  "semgrator": "^0.3.0",
79
79
  "undici": "^7.0.0",
80
- "@platformatic/client": "2.48.0",
81
- "@platformatic/generators": "2.48.0",
82
- "@platformatic/metrics": "2.48.0",
83
- "@platformatic/config": "2.48.0",
84
- "@platformatic/scalar-theme": "2.48.0",
85
- "@platformatic/ts-compiler": "2.48.0",
86
- "@platformatic/utils": "2.48.0",
87
- "@platformatic/telemetry": "2.48.0"
80
+ "@platformatic/client": "2.50.0",
81
+ "@platformatic/generators": "2.50.0",
82
+ "@platformatic/config": "2.50.0",
83
+ "@platformatic/scalar-theme": "2.50.0",
84
+ "@platformatic/metrics": "2.50.0",
85
+ "@platformatic/telemetry": "2.50.0",
86
+ "@platformatic/utils": "2.50.0",
87
+ "@platformatic/ts-compiler": "2.50.0"
88
88
  },
89
89
  "scripts": {
90
90
  "test": "pnpm run lint && borp -T --concurrency=1 --timeout=300000 && tsd",
package/schema.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/service/2.48.0.json",
3
- "version": "2.48.0",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/service/2.50.0.json",
3
+ "version": "2.50.0",
4
4
  "title": "Platformatic Service",
5
5
  "type": "object",
6
6
  "properties": {