Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Wolfgang Knopki
Spacedeck-open-SAML
Commits
0d92343d
Commit
0d92343d
authored
7 years ago
by
mntmn
Browse files
Options
Download
Email Patches
Plain Diff
fix redis mock incr()
parent
efb7970e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
helpers/redis.js
+4
-3
helpers/redis.js
with
4 additions
and
3 deletions
+4
-3
helpers/redis.js
+
4
-
3
View file @
0d92343d
'
use strict
'
;
// this is a mock version of the Redis API,
// emulating Redis if it is not available locally
var
notRedis
=
{
state
:
{},
topics
:
{},
publish
:
function
(
topic
,
msg
,
cb
)
{
//console.log("[notredis] publish",topic,msg);
if
(
!
this
.
topics
[
topic
])
{
this
.
topics
[
topic
]
=
{
subscribers
:
[]
...
...
@@ -43,7 +44,7 @@ var notRedis = {
t
.
subscribers
.
push
(
handle
);
}
cb
(
null
,
handle
,
topics
.
length
);
cb
(
null
,
topics
.
length
);
return
handle
;
},
...
...
@@ -82,7 +83,7 @@ var notRedis = {
incr
:
function
(
key
,
cb
)
{
if
(
!
this
.
state
[
key
])
this
.
state
[
key
]
=
0
;
this
.
state
[
key
]
++
;
cb
();
cb
(
null
,
this
.
state
[
key
]
);
},
expire
:
function
()
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets