🚨 Announcement: A New Chapter for Vendure read more

TypeORMHealthCheckStrategy

TypeORMHealthCheckStrategy

A HealthCheckStrategy used to check the health of the database. This health check is included by default, but can be customized by explicitly adding it to the systemOptions.healthChecks array:

Example

import { TypeORMHealthCheckStrategy } from '@vendure/core';

export const config = {
  // ...
  systemOptions: [
    // The default key is "database" and the default timeout is 1000ms
    // Sometimes this is too short and leads to false negatives in the
    // /health endpoint.
    new TypeORMHealthCheckStrategy({ key: 'postgres-db', timeout: 5000 }),
  ]
}

Signature

class TypeORMHealthCheckStrategy implements HealthCheckStrategy {
  constructor(options?: TypeORMHealthCheckOptions)
  async init(injector: Injector) => ;
  getHealthIndicator() => HealthIndicatorFunction;
}

Implements

Members

constructor

method
type:
(options?: TypeORMHealthCheckOptions) => TypeORMHealthCheckStrategy

init

async method
type:
(injector: Injector) =>

getHealthIndicator

method
type:
() => HealthIndicatorFunction