Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vernemq
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
stack
vernemq
Commits
2d9742e4
Commit
2d9742e4
authored
Nov 20, 2018
by
zCaesar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
device usage fix1
parent
fd970823
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
authhook/redis/on_offline.js
+2
-0
authhook/redis/on_register.js
+2
-0
No files found.
authhook/redis/on_offline.js
View file @
2d9742e4
...
@@ -29,6 +29,7 @@ function setValue(deviceid) {
...
@@ -29,6 +29,7 @@ function setValue(deviceid) {
}
}
function
deviceUsageCount
()
{
function
deviceUsageCount
()
{
console
.
log
(
'device_usage_offline'
)
redis
.
hincrby
(
'_broker:1'
,
'device_usage'
,
-
1
)
redis
.
hincrby
(
'_broker:1'
,
'device_usage'
,
-
1
)
}
}
module
.
exports
.
deviceUsageCount
=
deviceUsageCount
module
.
exports
.
deviceUsageCount
=
deviceUsageCount
\ No newline at end of file
authhook/redis/on_register.js
View file @
2d9742e4
...
@@ -32,6 +32,7 @@ function setValue(deviceid) {
...
@@ -32,6 +32,7 @@ function setValue(deviceid) {
}
}
function
deviceUsageCount
()
{
function
deviceUsageCount
()
{
console
.
log
(
'device_usage_online'
)
redis
.
hincrby
(
'_broker:1'
,
'device_usage'
,
1
)
redis
.
hincrby
(
'_broker:1'
,
'device_usage'
,
1
)
}
}
module
.
exports
.
deviceUsageCount
=
deviceUsageCount
module
.
exports
.
deviceUsageCount
=
deviceUsageCount
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment