You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
chore: remove second parameter from the client
This commit is contained in:
@@ -37,6 +37,8 @@ Breaking Changes
|
|||||||
- Removed `authPass` (auth_pass) option. Please use `password` instead
|
- Removed `authPass` (auth_pass) option. Please use `password` instead
|
||||||
- Removed `Redis.print` helper function
|
- Removed `Redis.print` helper function
|
||||||
- Removed backpressure indicator from function return value
|
- Removed backpressure indicator from function return value
|
||||||
|
- Removed the `stream` parameter from the RedisClient constructor.
|
||||||
|
Please set the stream in the options instead
|
||||||
- Changed return value of `(p)(un)subscribe`
|
- Changed return value of `(p)(un)subscribe`
|
||||||
- Return an array with the number of current subscribed channels and an array
|
- Return an array with the number of current subscribed channels and an array
|
||||||
with all affected channels
|
with all affected channels
|
||||||
|
6
index.js
6
index.js
@@ -27,11 +27,10 @@ class RedisClient extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Creates an instance of RedisClient.
|
* Creates an instance of RedisClient.
|
||||||
* @param {object} options
|
* @param {object} options
|
||||||
* @param {any} [stream]
|
|
||||||
*
|
*
|
||||||
* @memberof RedisClient
|
* @memberof RedisClient
|
||||||
*/
|
*/
|
||||||
constructor (options, stream) {
|
constructor (options) {
|
||||||
super()
|
super()
|
||||||
// Copy the options so they are not mutated
|
// Copy the options so they are not mutated
|
||||||
options = utils.clone(options)
|
options = utils.clone(options)
|
||||||
@@ -46,10 +45,9 @@ class RedisClient extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (stream) {
|
if (options.stream) {
|
||||||
// The stream from the outside is used so no connection from this side is triggered but from the server this client should talk to
|
// The stream from the outside is used so no connection from this side is triggered but from the server this client should talk to
|
||||||
// Reconnect etc won't work with this. This requires monkey patching to work, so it is not officially supported
|
// Reconnect etc won't work with this. This requires monkey patching to work, so it is not officially supported
|
||||||
options.stream = stream
|
|
||||||
this.address = '"Private stream"'
|
this.address = '"Private stream"'
|
||||||
} else if (options.path) {
|
} else if (options.path) {
|
||||||
cnxOptions.path = options.path
|
cnxOptions.path = options.path
|
||||||
|
Reference in New Issue
Block a user