Skip to content

Commit b4a116c

Browse files
authored
Remove old worker functions from bin/deepforge. Fixes #1616 (#1617)
1 parent 6387b96 commit b4a116c

2 files changed

Lines changed: 5 additions & 41 deletions

File tree

bin/deepforge

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -192,40 +192,6 @@ var startMongo = function (args, port, silent) {
192192
});
193193
};
194194

195-
const startLocal = function(serverCommand) {
196-
let stdout, workerJob=null;
197-
const env = {cwd: path.join(__dirname, '..'), NODE_ENV: process.env.NODE_ENV, PATH: process.env.PATH};
198-
// Set the cache to the blob
199-
if (gmeConfig.blob.type === 'FS') {
200-
process.env.DEEPFORGE_WORKER_CACHE = path.resolve(gmeConfig.blob.fsDir + '/wg-content');
201-
}
202-
203-
// process.env.NODE_ENV = 'local';
204-
const execJob = rawSpawn(serverCommand, [
205-
path.join(__dirname, '..', 'app.js')
206-
], {
207-
env: env,
208-
shell: SHELL
209-
});
210-
211-
execJob.stdout.pipe(process.stdout);
212-
execJob.stderr.pipe(process.stderr);
213-
214-
execJob.stdout.on('data', function(chunk) {
215-
if (!workerJob) {
216-
stdout += chunk;
217-
if (stdout.indexOf('DeepForge') > -1) {
218-
workerJob = rawSpawn('npm', ['run', 'worker'], env);
219-
workerJob.stdout.pipe(process.stdout);
220-
workerJob.stderr.pipe(process.stderr);
221-
workerJob.on('close', code => code && process.exit(code));
222-
}
223-
}
224-
});
225-
226-
execJob.on('close', code => code && process.exit(code));
227-
};
228-
229195
var spawn = function (cmd, args, opts) {
230196
var deferred = Q.defer(),
231197
job,
@@ -278,6 +244,11 @@ program.command('start')
278244
.option('-m, --mongo', 'start MongoDB')
279245
.action(async args => {
280246
const serverCommand = getDeepForgeServerCommand(args.conda);
247+
const startAll = !args.server && !args.mongo;
248+
if (startAll) {
249+
args.server = true;
250+
args.mongo = true;
251+
}
281252

282253
if (args.port) {
283254
process.env.PORT = args.port;
@@ -294,12 +265,6 @@ program.command('start')
294265
shell: SHELL
295266
});
296267
}
297-
298-
const startAll = !args.server && !args.mongo;
299-
if (startAll) {
300-
await checkMongo(args);
301-
startLocal(serverCommand);
302-
}
303268
});
304269

305270
// update

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"start-authenticated": "NODE_ENV=production ./bin/deepforge start",
1515
"server": "node ./bin/deepforge start --server",
1616
"no-conda-server": "node ./bin/deepforge start --server --no-conda",
17-
"worker": "node ./bin/start-worker.js",
1817
"test": "npm run test-unit && npm run test-int",
1918
"test-unit": "NODE_ENV=test mkdir ./test-tmp; mocha --recursive test/unit",
2019
"test-int": "NODE_ENV=test mkdir ./test-tmp; mocha --recursive test/integration",

0 commit comments

Comments
 (0)