Skip to content

Commit

Permalink
fix sub mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cokeeffekt committed Mar 22, 2020
1 parent c4e491f commit 1a95ad0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "snub",
"version": "2.0.3",
"version": "2.0.4",
"description": "pub/sub",
"main": "snub.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions snub.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ module.exports = function (config) {

eventsRegistered.push(ev);
try {
await redis.psubscribe(prefix + pattern);
await sub.psubscribe(prefix + pattern);
} catch (error) {
console.log('Snub Error => ' + error);
var evIndex = eventsRegistered.findIndex(e => e === ev);
Expand All @@ -130,7 +130,7 @@ module.exports = function (config) {
.map(v => eventsRegistered.findIndex(f => f === v))
.reverse().forEach(i => eventsRegistered.splice(i, 1));
if (!eventsRegistered.find(e => e.pattern === pattern))
await redis.punsubscribe(prefix + pattern);
await sub.punsubscribe(prefix + pattern);
};

// send to one listener
Expand Down

0 comments on commit 1a95ad0

Please sign in to comment.