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
45d6b5ff
Commit
45d6b5ff
authored
Dec 11, 2018
by
zCaesar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use old redis
parent
ac69165b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
5 deletions
+4
-5
authhook/auth_on_publish.js
+1
-1
authhook/auth_on_register.js
+1
-1
authhook/on_offline.js
+1
-1
authhook/redis-atomic/on_message.lua
+1
-2
No files found.
authhook/auth_on_publish.js
View file @
45d6b5ff
var
config
=
require
(
'config'
);
// https://github.com/isaacs/node-lru-cache
var
on_message_redis
=
require
(
'./redis
-atomic
/on_message'
).
on_message_redis
var
on_message_redis
=
require
(
'./redis/on_message'
).
on_message_redis
var
LRU
=
require
(
"lru-cache"
),
cache
=
LRU
({
max
:
500
,
...
...
authhook/auth_on_register.js
View file @
45d6b5ff
...
...
@@ -3,7 +3,7 @@ var validator = require('./validator');
var
config
=
require
(
'config'
);
// var seneca = require('seneca')({log: 'silent'}).client({ port: config.get('device_registry_port'), host: config.get('device_registry_host') });
var
seneca
=
require
(
'seneca'
)({
log
:
'silent'
}).
client
({
port
:
config
.
get
(
'token_registry_port'
),
host
:
config
.
get
(
'token_registry_host'
)
});
var
on_register_redis
=
require
(
'./redis
-atomic
/on_register'
).
on_register_redis
var
on_register_redis
=
require
(
'./redis/on_register'
).
on_register_redis
// https://github.com/isaacs/node-lru-cache
var
LRU
=
require
(
"lru-cache"
),
...
...
authhook/on_offline.js
View file @
45d6b5ff
var
on_offline_redis
=
require
(
'./redis
-atomic
/on_offline'
).
on_offline_redis
var
on_offline_redis
=
require
(
'./redis/on_offline'
).
on_offline_redis
module
.
exports
=
function
(
options
=
{})
{
...
...
authhook/redis-atomic/on_message.lua
View file @
45d6b5ff
...
...
@@ -7,8 +7,8 @@ local last_publish = ARGV[3]
redis
.
call
(
'HINCRBY'
,
device_keys
,
'actual_message_count'
,
1
)
redis
.
call
(
'HINCRBY'
,
device_keys
,
'charged_message_count'
,
charged_message_count
)
redis
.
call
(
'HINCRBY'
,
device_keys
,
'total_message_size'
,
total_message_size
)
redis
.
call
(
'HSET'
,
device_keys
,
'last_publish'
,
last_publish
)
redis
.
call
(
'HINCRBY'
,
broker_keys
,
'actual_message_count'
,
1
)
redis
.
call
(
'HINCRBY'
,
broker_keys
,
'charged_message_count'
,
charged_message_count
)
redis
.
call
(
'HINCRBY'
,
broker_keys
,
'total_message_size'
,
total_message_size
)
redis
.
call
(
'HSET'
,
device_keys
,
'last_publish'
,
last_publish
)
return
'true'
\ 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