From 903135c5bdad9320e7673699ae0838e7f65ff3c4 Mon Sep 17 00:00:00 2001 From: "Mohan, Krishna (CT DD DS AA DF-PD FH ES)" Date: Wed, 7 Feb 2024 21:00:59 +0530 Subject: [PATCH] Made id as the configurable field if it is explicitly provided. --- lib/daemon.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/daemon.js b/lib/daemon.js index e4f90b8..19f7b0a 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -324,9 +324,10 @@ var daemon = function (config) { // The ID for the process id: { enumerable: true, - get: function () { - return this.name.replace(/[^\w]/gi, '').toLowerCase(); - } + get: function () { + return this._id ? this._id : this.name.replace(/[^\w]/gi, '').toLowerCase(); + }, + set: function (value) { this._id = value; } }, // Description of the service