Commit 72c065c7 by zCaesar

add count reg

parent 20f5db56
......@@ -8,6 +8,7 @@ function on_offline_redis(deviceid) { // first time to access on authhook auth_o
}
else {
var information = setValue(deviceid)
redis.hincrby('_broker:1', 'count', -1)
redis.hset(information.keys, 'status', information.status, 'offline_on', information.offline_on, function (err, res) {
resolve(!res) // 0 is ok, 1 is no => if ok is 0 then not 0 = 1
})
......
......@@ -9,6 +9,7 @@ function on_register_redis(deviceid) { // first time to access on authhook auth_
else {
var information = setValue(deviceid)
redis.hdel(information.keys, 'offline_on')
redis.hincrby('_broker:1', 'count', 1)
redis.hset(information.keys, 'status', information.status, 'register_on', information.register_on, 'last_check', information.last_check, function (err, res) {
resolve(!res) // 0 is ok, 1 is no => if ok is 0 then not 0 = 1
})
......
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