Skip to content

Commit

Permalink
fix missing error handlers on pi-watch and pi-karma redis clients (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
DoobleD authored Nov 8, 2024
1 parent 828ae6b commit 0218938
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

### Unreleased

### [2.0.8] - 2024-11-08

- fix missing error handlers on pi-watch and pi-karma redis clients [#45](https://github.com/haraka/haraka-plugin-redis/issues/45)

### [2.0.7] - 2024-04-21

- populate [files] in package.json. Delete .npmignore.
Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ exports.redis_subscribe_pattern = async function (pattern, onMessage) {
if (this.redis) return // already subscribed?

this.redis = redis.createClient(this.redisCfg.pubsub)
this.redis.on('error', (err) => {
this.logerror(err.message)
})
await this.redis.connect()

await this.redis.pSubscribe(pattern, onMessage)
Expand All @@ -234,6 +237,9 @@ exports.redis_subscribe = async function (connection, onMessage) {
}, 3 * 1000)

connection.notes.redis = redis.createClient(this.redisCfg.pubsub)
connection.notes.redis.on('error', (err) => {
this.logerror(err.message)
})
await connection.notes.redis.connect()

clearTimeout(timer)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haraka-plugin-redis",
"version": "2.0.7",
"version": "2.0.8",
"description": "Redis plugin for Haraka & other plugins to inherit from",
"main": "index.js",
"files": [
Expand Down

0 comments on commit 0218938

Please sign in to comment.