Set device absent when provider is stopped.

This commit is contained in:
Simo Kinnunen
2014-12-18 16:14:41 +09:00
parent f275d9e563
commit 2f8116dfe6

View File

@@ -260,6 +260,14 @@ module.exports = function(options) {
log.info('Device worker "%s" has retired', device.id)
delete workers[device.id]
worker = null
// Tell others the device is gone
push.send([
wireutil.global
, wireutil.envelope(new wire.DeviceAbsentMessage(
device.id
))
])
})
.catch(procutil.ExitError, function(err) {
if (!willStop) {