From a9316c6ddf8f133414e0d85e08b90969528220ee Mon Sep 17 00:00:00 2001 From: Denny Pradipta Date: Wed, 8 Nov 2023 17:09:38 +0700 Subject: [PATCH] Fix: [SymonClient] Report worker path (#1168) * Fix: Include the workers when npm pack * Fix: [SymonClient] Report worker path --- src/symon/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/symon/index.ts b/src/symon/index.ts index 378d81ad8..8f976c67e 100644 --- a/src/symon/index.ts +++ b/src/symon/index.ts @@ -27,6 +27,7 @@ import { ExponentialBackoff, handleAll, retry } from 'cockatiel' import { EventEmitter } from 'events' import mac from 'macaddress' import { hostname } from 'os' +import path from 'path' import Piscina from 'piscina' import { updateConfig } from '../components/config' @@ -158,7 +159,8 @@ class SymonClient { private worker = new Piscina.Piscina({ concurrentTasksPerWorker: 1, - filename: `${process.cwd()}/lib/workers/report-to-symon.js`, + // eslint-disable-next-line unicorn/prefer-module + filename: path.join(__dirname, '../../lib/workers/report-to-symon.js'), idleTimeout: this.reportProbesInterval, maxQueue: 1, })