diff --git a/src/worker.js b/src/worker.js index abe374f..1314498 100644 --- a/src/worker.js +++ b/src/worker.js @@ -75,7 +75,7 @@ export default class Worker { // Write pid on a file if (this.config.pidFile) { try { - fs.writeFileSync(this.config.pidFile, process.pid.toString()); + fs.writeFileSync(this.config.pidFile, (process.pid || "").toString()); } catch (error) { this.logger.log({ level: 'error',