Skip to content

Commit da58a4c

Browse files
committed
Merge pull request #891 from NodeRedis/stuff
Fix some minor issues and increase coverage
2 parents 587b1c9 + 2a65ee4 commit da58a4c

16 files changed

+619
-391
lines changed

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ port and host are probably fine and you don't need to supply any arguments. `cre
175175
* `redis.createClient('redis://user:pass@host:port', options)`
176176
* `redis.createClient(port, host, options)`
177177

178-
`options` is an object with the following possible properties:
179-
178+
### `options` is an object with the following possible properties:
180179
* `host`: *127.0.0.1*; The host to connect to
181180
* `port`: *6370*; The port to connect to
182181
* `parser`: *hiredis*; Which Redis protocol reply parser to use. If `hiredis` is not installed it will fallback to `javascript`.
@@ -229,7 +228,7 @@ client.get(new Buffer("foo_rand000000000000"), function (err, reply) {
229228
client.end();
230229
```
231230

232-
## client.auth(password, callback)
231+
## client.auth(password[, callback])
233232

234233
When connecting to a Redis server that requires authentication, the `AUTH` command must be sent as the
235234
first command after connecting. This can be tricky to coordinate with reconnections, the ready check,
@@ -290,7 +289,7 @@ client.get("foo", function (err, value){
290289
Most Redis commands take a single String or an Array of Strings as arguments, and replies are sent back as a single String or an Array of Strings.
291290
When dealing with hash values, there are a couple of useful exceptions to this.
292291

293-
### client.hgetall(hash)
292+
### client.hgetall(hash, callback)
294293

295294
The reply from an HGETALL command will be converted into a JavaScript Object by `node_redis`. That way you can interact
296295
with the responses using JavaScript syntax.
@@ -310,7 +309,7 @@ Output:
310309
{ mjr: '1', another: '23', home: '1234' }
311310
```
312311

313-
### client.hmset(hash, obj, [callback])
312+
### client.hmset(hash, obj[, callback])
314313

315314
Multiple values in a hash can be set by supplying an object:
316315

@@ -440,7 +439,7 @@ client.multi()
440439
});
441440
```
442441

443-
### Multi.exec( callback )
442+
### Multi.exec([callback])
444443

445444
`client.multi()` is a constructor that returns a `Multi` object. `Multi` objects share all of the
446445
same command methods as `client` objects do. Commands are queued up inside the `Multi` object
@@ -492,7 +491,7 @@ client.multi([
492491
});
493492
```
494493

495-
### Multi.exec_atomic( callback )
494+
### Multi.exec_atomic([callback])
496495

497496
Identical to Multi.exec but with the difference that executing a single command will not use transactions.
498497

@@ -577,7 +576,7 @@ the second word as first parameter:
577576
client.multi().script('load', 'return 1').exec(...);
578577
client.multi([['script', 'load', 'return 1']]).exec(...);
579578

580-
## client.send_command(command_name, args, callback)
579+
## client.send_command(command_name[, [args][, callback]])
581580

582581
Used internally to send commands to Redis. Nearly all Redis commands have been added to the `client` object.
583582
However, if new commands are introduced before this library is updated, you can use `send_command()` to send arbitrary commands to Redis.
@@ -713,6 +712,7 @@ To get debug output run your `node_redis` application with `NODE_DEBUG=redis`.
713712

714713
## How to Contribute
715714
- Open a pull request or an issue about what you want to implement / change. We're glad for any help!
715+
- Please be aware that we'll only accept fully tested code.
716716

717717
## Contributors
718718
Many [people](https://github.com/NodeRedis/node_redis/graphs/contributors) have have added features and fixed bugs in `node_redis`. Thanks to all of them!

benchmarks/multi_bench.js

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ var metrics = require('metrics');
1010
var num_clients = parseInt(process.argv[2], 10) || 5;
1111
var num_requests = 50000;
1212
var tests = [];
13+
// var bluebird = require('bluebird');
14+
// bluebird.promisifyAll(redis.RedisClient.prototype);
15+
// bluebird.promisifyAll(redis.Multi.prototype);
1316
var versions_logged = false;
1417
var client_options = {
1518
return_buffers: false,

changelog.md

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
Changelog
22
=========
33

4+
## v.2.2.4 - 17 Oct, 2015
5+
6+
Bugfixes
7+
8+
- Fixed unspecific error message for unresolvable commands ([@BridgeAR](https://github.com/BridgeAR))
9+
- Fixed not allowed command error in pubsub mode not being returned in a provided callback ([@BridgeAR](https://github.com/BridgeAR))
10+
- Fixed to many commands forbidden in pub sub mode ([@BridgeAR](https://github.com/BridgeAR))
11+
- Fixed mutation of the arguments array passed to .multi / .batch constructor ([@BridgeAR](https://github.com/BridgeAR))
12+
- Fixed mutation of the options object passed to createClient ([@BridgeAR](https://github.com/BridgeAR))
13+
- Fixed error callback in .multi not called if connection in broken mode ([@BridgeAR](https://github.com/BridgeAR))
14+
415
## v.2.2.3 - 14 Oct, 2015
516

617
Bugfixes
718

8-
- Fix multi not being executed on Node 0.10.x if node_redis not yet ready ([@BridgeAR](https://github.com/BridgeAR))
19+
- Fixed multi not being executed on Node 0.10.x if node_redis not yet ready ([@BridgeAR](https://github.com/BridgeAR))
920

1021
## v.2.2.2 - 14 Oct, 2015
1122

1223
Bugfixes
1324

14-
- Fix regular commands not being executed after a .multi until .exec was called ([@BridgeAR](https://github.com/BridgeAR))
25+
- Fixed regular commands not being executed after a .multi until .exec was called ([@BridgeAR](https://github.com/BridgeAR))
1526

1627
## v.2.2.1 - 12 Oct, 2015
1728

@@ -34,7 +45,7 @@ Features
3445

3546
Bugfixes
3647

37-
- Fix a javascript parser regression introduced in 2.0 that could result in timeouts on high load. ([@BridgeAR](https://github.com/BridgeAR))
48+
- Fixed a javascript parser regression introduced in 2.0 that could result in timeouts on high load. ([@BridgeAR](https://github.com/BridgeAR))
3849
- I was not able to write a regression test for this, since the error seems to only occur under heavy load with special conditions. So please have a look for timeouts with the js parser, if you use it and report all issues and switch to the hiredis parser in the meanwhile. If you're able to come up with a reproducable test case, this would be even better :)
3950
- Fixed should_buffer boolean for .exec, .select and .auth commands not being returned and fix a couple special conditions ([@BridgeAR](https://github.com/BridgeAR))
4051

@@ -141,7 +152,7 @@ This is the biggest release that node_redis had since it was released in 2010. A
141152
- Do not wrap errors into other errors (@BridgeAR)
142153
- Authentication failures are now returned in the callback instead of being emitted (@BridgeAR)
143154
- Fix a memory leak on reconnect (@rahar)
144-
- Using `send_command` directly may no also be called without the args as stated in the [README.md](./README.md) (@BridgeAR)
155+
- Using `send_command` directly may now also be called without the args as stated in the [README.md](./README.md) (@BridgeAR)
145156
- Fix the multi.exec error handling (@BridgeAR)
146157
- Fix commands being inconsistent and behaving wrong (@BridgeAR)
147158
- Channel names with spaces are now properly resubscribed after a reconnection (@pbihler)

0 commit comments

Comments
 (0)