fix old version bug

This commit is contained in:
Josh Harvey 2016-03-17 17:11:35 +02:00
parent 593bcd6ed0
commit e3e091b873
2 changed files with 3 additions and 3 deletions

View file

@ -22,8 +22,8 @@ wreck.get('http://localhost:7070/pid?fingerprint=' + fingerprint, opts, function
process.exit(2)
}
if (!payload.pid) {
console.log('The requested lamassu-machine is not connected.')
if (!payload || !payload.pid) {
console.log('The requested lamassu-machine appears to be running an old version.')
process.exit(3)
}

View file

@ -26,7 +26,7 @@ function poll(req, res) {
var fingerprint = getFingerprint(req)
var pid = req.query.pid
if (pid) pids[fingerprint] = {pid: pid, ts: Date.now()}
pids[fingerprint] = {pid: pid, ts: Date.now()}
logger.debug('poll request from: %s', fingerprint);