Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

spawn sync only with --fork #25

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function start_server(opts, callback) {
}

if (opts.args.fork === undefined) {
opts.args.fork = true;
opts.args.fork = false;
}

if (!opts.args.logpath) {
Expand All @@ -68,7 +68,8 @@ function start_server(opts, callback) {

function start() {
debug("spawn", bpath + "mongod", args.join(' '));
var child = spawnSync(bpath + "mongod", args);
var spawn = (opts.args.fork)? spawnSync : require('child_process').spawn;
var child = spawn(bpath + "mongod", args);
mongodb_logs(child.stdout.toString());
mongodb_logs(child.stderr.toString());

Expand Down