From 937022b59dec0b75d375629a69161d578a3a4162 Mon Sep 17 00:00:00 2001 From: arshiam2 <arshiam2@illinois.edu> Date: Sun, 7 Oct 2018 20:52:16 -0500 Subject: [PATCH] wip --- inroducer/index.js | 4 ++-- machine/index.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inroducer/index.js b/inroducer/index.js index 90f842d..b76e2ae 100644 --- a/inroducer/index.js +++ b/inroducer/index.js @@ -149,8 +149,8 @@ socket.on("message", function(message, rinfo) { if (text[0] === "dead") { console.log(text) console.log(text[1].toString()[0]) - machines = machines.filter(m => m.toString()[0] !== text[1].toString()[0]); - console.log(machines) + // machines = machines.filter(m => m.toString()[0] !== text[1].toString()[0]); + // console.log(machines) } }); diff --git a/machine/index.js b/machine/index.js index 8ead3a2..57081f6 100644 --- a/machine/index.js +++ b/machine/index.js @@ -118,7 +118,7 @@ function updateTimeStamp(ackMachineNumber) { function updateStatuses() { Object.keys(connections).forEach(connection => { - if (Date.now() - connections[connection].timestamp >= 2000) { + if (Date.now() - connections[connection].timestamp >= 2000 && connections[connection].timestamp != 0) { connections[connection].status = "dead" const message = Buffer.from(`dead ${connection}`); -- GitLab