haraka-plugin-redis
Advanced tools
Comparing version 2.0.1 to 2.0.2
### 2.0.1 - 2022-05-23 | ||
### 2.0.2 - 2022-05-23 | ||
- fix: rename p* methods -> * (required in redis v4) | ||
- fix: add `await ...connect()` as is now required, fixes #32 | ||
- dep(redis): bump 4.0 -> 4.1 | ||
@@ -7,0 +8,0 @@ |
14
index.js
@@ -197,8 +197,9 @@ 'use strict'; | ||
this.redis = await redis.createClient(this.redisCfg.pubsub) | ||
await this.redis.connect() | ||
await this.redis.subscribe(pattern); | ||
this.logdebug(this, `subscribed to ${pattern}`); | ||
await this.redis.pSubscribe(pattern); | ||
this.logdebug(this, `pSubscribed to ${pattern}`); | ||
} | ||
exports.redis_subscribe = async function (connection, event) { | ||
exports.redis_subscribe = async function (connection) { | ||
@@ -215,2 +216,3 @@ if (connection.notes.redis) { | ||
connection.notes.redis = await redis.createClient(this.redisCfg.pubsub) | ||
await connection.notes.redis.connect() | ||
@@ -220,4 +222,4 @@ clearTimeout(timer); | ||
const pattern = this.get_redis_sub_channel(connection) | ||
connection.notes.redis.subscribe(pattern, event); | ||
connection.logdebug(this, `subscribed to ${pattern}`); | ||
connection.notes.redis.pSubscribe(pattern); | ||
connection.logdebug(this, `pSubscribed to ${pattern}`); | ||
} | ||
@@ -235,3 +237,3 @@ | ||
connection.logdebug(this, `unsubsubscribed from ${pattern}`); | ||
connection.notes.redis.disconnect(); | ||
connection.notes.redis.quit(); | ||
} |
{ | ||
"name": "haraka-plugin-redis", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Redis plugin for Haraka & other plugins to inherit from", | ||
@@ -13,6 +13,6 @@ "main": "index.js", | ||
"devDependencies": { | ||
"eslint": "^8.12.0", | ||
"eslint": "8", | ||
"eslint-plugin-haraka": "*", | ||
"haraka-test-fixtures": "*", | ||
"mocha": "^9.2.0" | ||
"mocha": "9" | ||
}, | ||
@@ -19,0 +19,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16880
277