mirror of
https://github.com/koush/scrypted.git
synced 2026-04-28 18:50:29 +01:00
server: add explicit hook for main file
This commit is contained in:
@@ -9,7 +9,7 @@ import net from "net";
|
||||
|
||||
export class NodeForkWorker extends ChildProcessWorker {
|
||||
|
||||
constructor(pluginId: string, options: RuntimeWorkerOptions) {
|
||||
constructor(mainFilename: string, pluginId: string, options: RuntimeWorkerOptions) {
|
||||
super(pluginId, options);
|
||||
|
||||
const {env, pluginDebug} = options;
|
||||
@@ -19,7 +19,7 @@ export class NodeForkWorker extends ChildProcessWorker {
|
||||
execArgv.push(`--inspect=0.0.0.0:${pluginDebug.inspectPort}`);
|
||||
}
|
||||
|
||||
this.worker = child_process.fork(require.main.filename, ['child', this.pluginId], {
|
||||
this.worker = child_process.fork(mainFilename, ['child', this.pluginId], {
|
||||
stdio: ['pipe', 'pipe', 'pipe', 'ipc'],
|
||||
env: Object.assign({}, process.env, env, {
|
||||
NODE_PATH: path.join(getPluginNodePath(this.pluginId), 'node_modules'),
|
||||
|
||||
Reference in New Issue
Block a user