mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-28 22:19:41 -08:00
refactor(core): Rename healthcheck to health check (#12122)
This commit is contained in:
parent
c5effca7d4
commit
8bb0d3d823
|
@ -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();
|
||||
});
|
||||
});
|
|
@ -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'));
|
||||
|
|
Loading…
Reference in a new issue