That's now working

This commit is contained in:
Hiro Protagonist 2017-04-14 11:55:19 +12:00
parent 8f7eca8a30
commit 97a70e6d45

10
main.js
View file

@ -139,7 +139,7 @@ function imDead(why, e = '') {
socket.emit('change', { socket.emit('change', {
type: 'startStop', type: 'startStop',
change: { change: {
running: 1, running: 1
} }
}); });
if (restart) { if (restart) {
@ -158,8 +158,8 @@ function imDead(why, e = '') {
function criticalProblem(err, e, handler, ...args) { function criticalProblem(err, e, handler, ...args) {
if (!mustBe) { if (!mustBe) {
setTimeout(function() { setTimeout(function() {
status.running = 2 status.running = 2;
status.error = err status.error = err;
logger.log(importance[3], 'Critical Problem: ' + errors[err] + '\n' + e); logger.log(importance[3], 'Critical Problem: ' + errors[err] + '\n' + e);
socket.emit('change', { socket.emit('change', {
type: 'error', type: 'error',
@ -175,7 +175,7 @@ function criticalProblem(err, e, handler, ...args) {
} }
function handleDisc(info) { function handleDisc(info) {
let [host, port] = info let [host, port] = info;
isReachable(host, port, is => { isReachable(host, port, is => {
if (is) { if (is) {
spawn(); spawn();
@ -221,7 +221,7 @@ var commandHandlers = function commandHandlers(command, cb) {
if (status.running === 0) { if (status.running === 0) {
logger.log(importance[1], "Stop Command!"); logger.log(importance[1], "Stop Command!");
mustBe = true; mustBe = true;
stopFFMPEG(); cmd.kill();
socket.emit('data', { socket.emit('data', {
type: 'message', type: 'message',
data: { data: {