-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.js
32 lines (26 loc) · 944 Bytes
/
start.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const forever = require('forever-monitor');
const SENDEMAIL = require('./lib/email')
//const send_email = SENDEMAIL()
const moment = require('moment')
var child = new (forever.Monitor)('exchange.js', {
append: true,
silent: false,
logFile:"/home/server-hit/log_sms2app/forever.log",
outFile: "/home/server-hit/log_sms2app/sms2.log",
errFile: "/home/server-hit/log_sms2app/sms2_error.log",
command: 'node --max_old_space_size=2000',
args: []
});
child.on('restart', function () {
console.log('exchange.js has been started on port 8084');
var time = moment().format()
SENDEMAIL.sendEmail("SMS2 app started","The middleware was started on "+ time,()=>{
})
});
child.on('exit', function () {
console.log('Exchange js has stoped');
var time = moment().format()
SENDEMAIL.sendEmail("SMS2 app stoped","The middleware was stopped on "+ time,()=>{
})
});
child.start();