mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-12 02:19:43 +00:00
feat(core): Set OS process titles for n8n processes (#39362)
This commit is contained in:
@@ -7,6 +7,8 @@ import type { HealthCheckServer } from './health-check-server';
|
||||
import { JsTaskRunner } from './js-task-runner/js-task-runner';
|
||||
import { TaskRunnerSentry } from './task-runner-sentry';
|
||||
|
||||
process.title = 'n8n task-runner';
|
||||
|
||||
// Initialize module paths from NODE_PATH environment variable.
|
||||
// This is necessary because Node.js doesn't automatically pick up NODE_PATH
|
||||
// after the process starts. Without this, external npm packages installed
|
||||
|
||||
@@ -6,6 +6,10 @@ const path = require('path');
|
||||
// did get started from another folder that the root one.
|
||||
process.env.NODE_CONFIG_DIR = process.env.NODE_CONFIG_DIR || path.join(__dirname, 'config');
|
||||
|
||||
// Must stay shorter than the original command line.
|
||||
// See https://nodejs.org/api/process.html#processtitle
|
||||
process.title = process.argv[2] ? `n8n ${process.argv[2]}` : 'n8n';
|
||||
|
||||
// Check if version should be displayed
|
||||
const versionFlags = ['-v', '-V', '--version'];
|
||||
if (versionFlags.includes(process.argv.slice(-1)[0])) {
|
||||
|
||||
Reference in New Issue
Block a user