Skip to content

Commit a28e8dc

Browse files
committed
chore: Update package name and version; enhance RedisChannelConfig connection options
1 parent bd4d68e commit a28e8dc

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@nestjstools/messaging-redis-extension",
3-
"version": "1.2.2",
2+
"name": "@kastov/messaging-redis-extension",
3+
"version": "1.3.0",
44
"description": "Extension to handle messages and dispatch them over Redis",
55
"author": "Sebastian Iwanczyszyn",
66
"private": false,
@@ -106,4 +106,4 @@
106106
"coverageDirectory": "../coverage",
107107
"testEnvironment": "node"
108108
}
109-
}
109+
}

src/channel/redis.channel-config.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,14 @@ export class RedisChannelConfig extends ChannelConfig {
3838
}
3939

4040
interface Connection {
41-
host: string;
42-
port: number;
41+
connectionOpts:
42+
| {
43+
host: string;
44+
port: number;
45+
}
46+
| {
47+
path: string;
48+
};
4349
password?: string;
4450
db?: number;
4551
}

src/channel/redis.channel-factory.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import { RedisChannelConfig } from './redis.channel-config';
55

66
@Injectable()
77
@ChannelFactory(RedisChannelConfig)
8-
export class RedisChannelFactory
9-
implements IChannelFactory<RedisChannelConfig>
10-
{
8+
export class RedisChannelFactory implements IChannelFactory<RedisChannelConfig> {
119
create(channelConfig: RedisChannelConfig): RedisChannel {
1210
return new RedisChannel(channelConfig);
1311
}

src/channel/redis.channel.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ export class RedisChannel extends Channel<RedisChannelConfig> {
99
constructor(config: RedisChannelConfig) {
1010
super(config);
1111
this.queue = new Queue(config.queue, {
12-
connection: this.config.connection,
12+
connection: {
13+
...this.config.connection.connectionOpts,
14+
password: this.config.connection.password,
15+
db: this.config.connection.db,
16+
},
1317
prefix: config.keyPrefix,
1418
defaultJobOptions: {
1519
removeOnComplete: config.bullJobOptions?.removeOnComplete,

0 commit comments

Comments
 (0)