Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
processes.server = new (forever.Monitor)(path.join(serverDirectory, 'index.js'), {
max: 1,
args: ['--color'],
watch: true,
watchIgnoreDotFiles: true,
watchDirectory: serverDirectory
});
processes.server.on('watch:restart', function(info) {
console.log('\n%s: detected change to %s', chalk.bold.green('(restart)'), chalk.cyan(info.stat));
});
console.log('------------------------------------------------');
console.log('Starting MongoDB...');
processes.db = forever.start(['mongod'], {
max: 1,
silent: true
});
processes.db.on('start', function () {
console.log('MongoDB is ready on', chalk.cyan(mongo));
console.log('------------------------------------------------');
console.log('\nStarting Node server...');
processes.server.start();
});
processes.db.on('exit', function () {
if (processes.server.running) {
processes.server.stop();
promptForOptions(program, function (program) {
var child = forever.start([
process.execPath,
path.resolve(__dirname, './quilt-init.js'),
path.resolve(program.mount),
program.remote
], {
max: Infinity,
silent: !program.verbose,
spinSleepTime: 60000,
minUptime: 1000,
killTree: true
});
child.on('restart', function () {
console.log('Quilt died. Restarting...');
});
start() {
const sh = this.getStartSh();
logger.info('[==== ice-speedy ====] Engine start sh===>', sh);
this.instance = forever.start(sh, {
max: 10,
parser: function(command, args) {
return {
command: command,
args: args,
};
},
silent: !is.dev(),
});
const { child } = this.instance;
logger.info('[==== ice-speedy ====] Engine pid===>', child.pid);
this.instance.on('error', err => {
logger.info(`[==== ice-speedy ====] Engine error===> ${err}`);
});
$ctx.returnValue = defer((function(resolve, reject) {
change_status("starting");
$__0.child = forever.start(args, {
max: 5,
silent: true,
pidFile: config("paths:unfsd_pid")
});
$__0.child.on('start', (function() {
change_status("started", {
port: port,
file: file
});
resolve();
}));
}));
$ctx.state = -2;
module.exports = function(app, secureApp) {
var args = process.argv;
var child
args.splice(args.indexOf('--forever',1))
child = forever.start(args, {
max : 5
});
};
start () {
const sh = this.getStartSh()
logger.info('[negibox] Engine start sh===>', sh)
this.instance = forever.start(sh, {
max: 100,
parser: function (command, args) {
return {
command: command,
args: args
}
},
silent: !process.env.DEV
})
const { child } = this.instance
logger.info('[negibox] Engine pid===>', child.pid)
this.instance.on('error', (err) => {
logger.info(`[negibox] Engine error===> ${err}`)
})
return defer((function(resolve, reject, notify) {
var child = forever.start(cmd, {
max: 1,
silent: true,
pidFile: pid
});
child.on('exit:code', (function() {
reject();
process.kill(process.pid);
}));
child.on('start', (function() {
return resolve(child);
}));
}));
},
return defer((resolve) => {
change_status("starting");
this.child = forever.start(args, {
max : 5,
silent : true,
pidFile: config("paths:unfsd_pid")
});
this.child.on('start', () => {
change_status("started", { port: port, file: file });
resolve();
});
});
});
start () {
const sh = this.getStartSh()
logger.info('[Motrix] Engine start sh===>', sh)
this.instance = forever.start(sh, {
max: 100,
parser: function (command, args) {
return {
command: command,
args: args
}
},
silent: !is.dev()
})
const { child } = this.instance
logger.info('[Motrix] Engine pid===>', child.pid)
this.instance.on('error', (err) => {
logger.info(`[Motrix] Engine error===> ${err}`)
})