bugfix
This commit is contained in:
parent
5d043b6f64
commit
04045e8162
13
bot.js
13
bot.js
@ -1,5 +1,5 @@
|
|||||||
var forever = require('forever-monitor');
|
var forever = require(__dirname+'/node_modules/forever-monitor');
|
||||||
var fs = require('fs-extra');
|
var fs = require(__dirname+'/node_modules/fs-extra');
|
||||||
|
|
||||||
var getDateTimeString = () => {
|
var getDateTimeString = () => {
|
||||||
var date = new Date();
|
var date = new Date();
|
||||||
@ -14,16 +14,17 @@ var getDateTimeString = () => {
|
|||||||
day = (day < 10 ? "0" : "") + day;
|
day = (day < 10 ? "0" : "") + day;
|
||||||
return year + "-" + month + "-" + day + "_" + hour + "-" + min;
|
return year + "-" + month + "-" + day + "_" + hour + "-" + min;
|
||||||
};
|
};
|
||||||
var log_forever = './log/forever_'+getDateTimeString()+'.log';
|
var log_forever = __dirname+'/log/forever_'+getDateTimeString()+'.log';
|
||||||
var log_bot = './log/bot_'+getDateTimeString()+'.log';
|
var log_bot = __dirname+'/log/bot_'+getDateTimeString()+'.log';
|
||||||
var err_bot = './log/err_'+getDateTimeString()+'.log';
|
var err_bot = __dirname+'/log/err_'+getDateTimeString()+'.log';
|
||||||
var putlog = (msg) => {
|
var putlog = (msg) => {
|
||||||
fs.appendFileSync(log_forever, msg, 'utf8');
|
fs.appendFileSync(log_forever, msg, 'utf8');
|
||||||
};
|
};
|
||||||
|
|
||||||
var child = new (forever.Monitor)('./src/main.js', {
|
var child = new (forever.Monitor)(__dirname+'/src/main.js', {
|
||||||
max: 1,
|
max: 1,
|
||||||
silent: false,
|
silent: false,
|
||||||
|
cwd: __dirname,
|
||||||
args: [],
|
args: [],
|
||||||
spinSleepTime: 2000,
|
spinSleepTime: 2000,
|
||||||
watch: true,
|
watch: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user