From c9c892c69d7c79f1c3904a36ed044869d5907d0d Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Fri, 5 Jun 2015 10:58:03 +0900 Subject: [PATCH] When receiving an introduction message, silently drop any previous value in the reaper. Fixes a bug where restarting a provider would not bring the devices online due to it starting within the heartbeat ttl, leading the reaper to believe it has been connected all along. --- lib/units/reaper/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/units/reaper/index.js b/lib/units/reaper/index.js index 0c961b23..5a7c1d9b 100644 --- a/lib/units/reaper/index.js +++ b/lib/units/reaper/index.js @@ -92,6 +92,7 @@ module.exports = function(options) { function listenToChanges() { sub.on('message', wirerouter() .on(wire.DeviceIntroductionMessage, function(channel, message) { + ttlset.drop(message.serial, TtlSet.SILENT) ttlset.bump(message.serial, Date.now()) }) .on(wire.DeviceHeartbeatMessage, function(channel, message) {