refactor(core): Rename healthcheck to health check (#12122)

This commit is contained in:
Tomi Turtiainen 2024-12-10 13:00:30 +02:00 committed by GitHub
parent c5effca7d4
commit 8bb0d3d823
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View file

@ -1,7 +1,7 @@
import { ApplicationError } from 'n8n-workflow';
import { createServer } from 'node:http';
export class HealthcheckServer {
export class HealthCheckServer {
private server = createServer((_, res) => {
res.writeHead(200);
res.end('OK');
@ -21,7 +21,7 @@ export class HealthcheckServer {
this.server.listen(port, host, () => {
this.server.removeListener('error', portInUseErrorHandler);
console.log(`Healthcheck server listening on ${host}, port ${port}`);
console.log(`Health check server listening on ${host}, port ${port}`);
resolve();
});
});

View file

@ -3,10 +3,10 @@ import Container from 'typedi';
import { MainConfig } from './config/main-config';
import type { ErrorReporter } from './error-reporter';
import type { HealthcheckServer } from './healthcheck-server';
import type { HealthCheckServer } from './health-check-server';
import { JsTaskRunner } from './js-task-runner/js-task-runner';
let healthcheckServer: HealthcheckServer | undefined;
let healthCheckServer: HealthCheckServer | undefined;
let runner: JsTaskRunner | undefined;
let isShuttingDown = false;
let errorReporter: ErrorReporter | undefined;
@ -29,7 +29,7 @@ function createSignalHandler(signal: string, timeoutInS = 10) {
if (runner) {
await runner.stop();
runner = undefined;
void healthcheckServer?.stop();
void healthCheckServer?.stop();
}
if (errorReporter) {
@ -68,9 +68,9 @@ void (async function start() {
const { enabled, host, port } = config.baseRunnerConfig.healthcheckServer;
if (enabled) {
const { HealthcheckServer } = await import('./healthcheck-server');
healthcheckServer = new HealthcheckServer();
await healthcheckServer.start(host, port);
const { HealthCheckServer } = await import('./health-check-server');
healthCheckServer = new HealthCheckServer();
await healthCheckServer.start(host, port);
}
process.on('SIGINT', createSignalHandler('SIGINT'));