From 8c45aa4ffc87f324174c36b787b79f811529c781 Mon Sep 17 00:00:00 2001 From: hobbyquaker Date: Sun, 1 Oct 2017 18:47:36 +0200 Subject: [PATCH] fix worker path --- lib/core.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core.js b/lib/core.js index ce1979f..9d5ce8c 100644 --- a/lib/core.js +++ b/lib/core.js @@ -1,6 +1,7 @@ /* eslint-disable no-case-declarations, no-restricted-modules */ const os = require('os'); +const path = require('path'); const cluster = require('cluster'); const EventEmitter = require('events').EventEmitter; const oe = require('obj-ease'); @@ -34,7 +35,7 @@ class Core extends EventEmitter { timeEnd = () => {}; } - require('./backend/' + this.backend + '.js')(this); + require(path.join(__dirname, 'backend', this.backend + '.js'))(this); this.workers = []; @@ -42,7 +43,7 @@ class Core extends EventEmitter { this.numWorkers = config.workers || os.cpus().length; cluster.setupMaster({ - exec: 'lib/worker.js', + exec: path.join(__dirname, 'worker.js'), args: [], silent: false });