Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
switch back to fork
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordon Hall committed Jan 11, 2017
1 parent fc68fa8 commit a09ace0
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const fs = require('fs');
const {statSync, readFileSync} = require('fs');
const stripJsonComments = require('strip-json-comments');
const JsonLogger = require('kad-logger-json');
const {spawn} = require('child_process');
const {fork} = require('child_process');
const utils = require('./utils');
const path = require('path');

Expand All @@ -20,7 +20,6 @@ class RPC {
constructor(options={}) {
this.logger = new JsonLogger(options.logVerbosity);
this.shares = new Map();
this._execPath = options.execPath || 'node';
}

/**
Expand Down Expand Up @@ -99,12 +98,11 @@ class RPC {
let uptimeCounter = setInterval(() => share.meta.uptimeMs += 1000, 1000);

// NB: Fork the actual farmer process, passing it the configuration
share.process = spawn(
self._execPath,
[path.join(__dirname, '../script/farmer.js'), '--config', configPath],
share.process = fork(
path.join(__dirname, '../script/farmer.js'),
['--config', configPath],
{
stdio: [0, 'pipe', 'pipe', 'ipc'],
detached: false
stdio: [0, 'pipe', 'pipe', 'ipc']
}
);
share.readyState = RPC.SHARE_STARTED;
Expand Down

0 comments on commit a09ace0

Please sign in to comment.