bye forever, forever
This commit is contained in:
parent
6b6fab41c7
commit
1d44d7baa1
31
src/index.js
31
src/index.js
@ -1,31 +0,0 @@
|
||||
const forever = require(__dirname+'/../node_modules/forever-monitor');
|
||||
|
||||
var child = new (forever.Monitor)(`${__dirname}/bot.js`, {
|
||||
max: 1,
|
||||
silent: false,
|
||||
cwd: __dirname,
|
||||
args: [],
|
||||
spinSleepTime: 5000,
|
||||
watch: true,
|
||||
watchIgnoreDotFiles: true,
|
||||
watchIgnorePatterns: [
|
||||
'node_modules/*',
|
||||
'tmp/*'
|
||||
],
|
||||
watchDirectory: __dirname
|
||||
});
|
||||
|
||||
child.on('watch:restart', info => {
|
||||
console.log(`Restaring bot because ${info.stat} changed`);
|
||||
});
|
||||
child.on('restart', () => {
|
||||
console.log(`restarting bot for ${child.times} time`);
|
||||
});
|
||||
child.on('start', () => {
|
||||
console.log('starting bot');
|
||||
});
|
||||
child.on('exit:code', code => {
|
||||
console.log(`detected bot exited with code ${code}`);
|
||||
//child.restart();
|
||||
});
|
||||
child.start();
|
Loading…
Reference in New Issue
Block a user