Add more logging to isolate case where slave stops reporting to master

This commit is contained in:
Danielv123 committed 2017-04-13 13:45:49 +02:00
1 parent 8e0abf5e2d
commit 9971b9f5b3
1 file changed
+6 -4
+6 -4
View File
@@ -278,8 +278,7 @@ write-data=__PATH__executable__/../../../instances/" + instance + "\r\n\
// getID(); // getID();
}).on('disconnected', function () { }).on('disconnected', function () {
console.log('Clusterio | Disconnected!'); console.log('Clusterio | Disconnected!');
// now reconnect process.exit(0); // exit because RCON disconnecting is undefined behaviour and we rather just wanna restart now
client.connect();
}); });
// set some globals // set some globals
@@ -391,9 +390,12 @@ function instanceManagement() {
require('getmac').getMac(function (err, mac) { require('getmac').getMac(function (err, mac) {
if (err) throw err if (err) throw err
payload.mac = mac payload.mac = mac
// console.log(payload) console.log("Registered our precense with master at " + payload.time);
needle.post(config.masterIP + ":" + config.masterPort + '/api/getID', payload, function (err, response, body) { needle.post(config.masterIP + ":" + config.masterPort + '/api/getID', payload, function (err, response, body) {
if (response && response.body) { if (err){
console.error("We got problems, something went wrong when contacting master");
console.error(err);
} else if (response && response.body) {
// In the future we might be interested in whether or not we actually manage to send it, but honestly I don't care. // In the future we might be interested in whether or not we actually manage to send it, but honestly I don't care.
console.log(response.body) console.log(response.body)
} }