Don't spam internal errors when server is paused/shutting down

This commit is contained in:
Daniel Vestøl committed 2018-06-13 20:59:39 +02:00
1 parent b7f76bf451
commit e4c276054b
2 files changed
+4 -3

No files matched your search

+3 -2
View File
@@ -88,11 +88,12 @@ async function messageInterfaceInternal(command, callback, resolve, reject) {
if(typeof callback == "function") callback(str)
resolve(str)
} catch (err) {
console.log(err);
console.log("RCON failed, server might be paused or shutting down");
// console.log(err);
// reject(err);
if(typeof callback == "function"){
callback();
}
reject(err)
}
}
}
+1 -1
View File
@@ -1079,7 +1079,7 @@ class wsSlave {
runCommand(command, callback){
let commandID = Math.random().toString();
this.socket.emit("runCommand", {command, commandID});
this.commandsWaitingForReturn[commandID] = {callback, timestamp: Date.now()};
if(commandID) this.commandsWaitingForReturn[commandID] = {callback, timestamp: Date.now()};
}
}
io.on('connection', function (socket) {