Commit 045aaf2a by zCaesar

edit redis check

parent d7112e7b
......@@ -13,8 +13,8 @@ function on_offline_redis(deviceid) { // first time to access on authhook auth_o
console.log('res:', res)
if (res) {
deviceUsageCount()
resolve(!res) // 0 is ok, 1 is no => if ok is 0 then not 0 = 1
} else resolve(!res)
resolve(true) // 0 is ok, 1 is no => if ok is 0 then not 0 = 1
} else resolve(false)
})
}
})
......
......@@ -13,10 +13,10 @@ function on_register_redis(deviceid) { // first time to access on authhook auth_
console.log(information.keys)
redis.hset(information.keys, 'status', information.status, 'register_on', information.register_on, 'last_check', information.last_check, function (err, res) {
console.log('res: ',res)
if (!res) {
if (res) {
deviceUsageCount()
resolve(!res) // 0 is ok, 1 is no => if ok is 0 then not 0 = 1
} else resolve(!res)
resolve(true) // 0 is ok, 1 is no => if ok is 0 then not 0 = 1
} else resolve(false)
})
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment