1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00
Commit Graph

456 Commits

Author SHA1 Message Date
Joffrey F
98a190830b Support null values in arrays in reply_to_strings() 2013-03-16 09:13:40 -07:00
Joffrey F
229be2068c Support null values in arrays in reply_to_strings() 2013-03-16 09:13:40 -07:00
Jonas Dohse
67e908ad55 Avoid collision between command and internal field 2013-03-15 22:34:32 +01:00
Tomasz Durka
38dbacac9f Add retry_max_delay option
- add option
- add test
2013-03-12 12:31:19 +01:00
DTrejo
405011b640 Revert "hmset throws/errors out on non-string values. fixes #218"
Reverting because this was a documentation problem, not a problem with
the code. Performance-wise, this is faster than the approach in #345, though
it may cause users more trouble. This is okay, if someone opens an issue we
can point them to the docs.

This reverts commit b60e001fa0.

Conflicts:

	index.js
	test.js
2013-02-23 22:56:08 -05:00
Tom Leach
837cec36b6 Detect is an incoming "reply" is in fact a pubsub message. If so, do not pop the command queue.
This fixes an issue where the command queue gets popped prematurely by pubsub
messages, leading to callbacks for those commands not being invoked.

Close #360.

Signed-off-by: DTrejo <david.daniel.trejo@gmail.com>
2013-02-23 22:42:34 -05:00
Jonas Dohse
f0ae6642f9 Use first word of multi word commands
Close #363.

Signed-off-by: DTrejo <david.daniel.trejo@gmail.com>
2013-02-23 22:18:13 -05:00
DTrejo
938c0526a0 EVAL: allow parameters as an array. Close #368.
Signed-off-by: DTrejo <david.daniel.trejo@gmail.com>
2013-02-23 22:05:34 -05:00
roam
11db346e73 Fixed an unexpected exception bug when reconnecting in pub/sub mode if selected_db is not null
RedisClient might enter pub/sub mode after at least one SELECT command issued.
When reconnecting, the SELECT command is issued after restoring pub_sub_command to true, which causes an exception.
2012-12-19 15:04:07 +08:00
Matt Ranney
c3ea30ebea Merge pull request #303 from mowaken/master
fixed RedisClient.prototype.end()
2012-11-02 15:01:53 -07:00
Jan Matousek
cc3a1da543 fix whitespace usage 2012-10-18 19:38:39 +02:00
Jan Matousek
71070d84fb Remove unused variable reference 2012-10-18 19:37:37 +02:00
Richard Mok
a9626578df RedisClient.prototype.end function bug fixed.
An uncaught exception will be raised when the retry timer tries to
reconnect and encounter an error, for all event listeners of the stream
were removed in line 826. It should set closing varable to be true.
2012-10-11 16:07:36 +08:00
Matt Ranney
670c256e35 Whitespace and other JSHint changes. 2012-09-10 22:50:54 -07:00
Martín Ciparelli
124ea082b9 fixes #218 by expanding last argument array only for sadd command
Also adds a test that uses SADD in caps. Nicely enough, this makes
multi_bench.js run just a tiny bit faster :)

Signed-off-by: DTrejo <david.trejo@voxer.com>
2012-08-17 15:33:32 -07:00
Kevin Ingersoll
c8103928b4 Attempt evalsha before eval
Fix #253

Signed-off-by: DTrejo <david.trejo@voxer.com>
2012-08-16 13:51:32 -07:00
Ignacio Burgueño
50914baa7f Save and clear client state. Restore it after the connection is ready.
This change stores the connection state regarding subscriptions,
selected db and monitoring. When the connection to Redis drops, the state
is reestablished after a succesful reconnect. Fixes #241. Fixes #210.

Signed-off-by: DTrejo <david.trejo@voxer.com>
2012-07-12 17:19:16 -07:00
DTrejo
1b0b2dc87d index.js: fix enable_offline_queue default. tests pass 2012-07-05 19:18:26 -07:00
Shankar Karuppiah
71a52638de Added checking for callback before attempting to execute the callback
Signed-off-by: DTrejo <david.trejo@voxer.com>
2012-07-05 19:04:19 -07:00
Shankar Karuppiah
83dc4c999b Added option to disable offline queue
Signed-off-by: DTrejo <david.trejo@voxer.com>
2012-07-05 19:04:10 -07:00
Trae Robrock
eb005b10df Forgot a comma
Signed-off-by: DTrejo <david.trejo@voxer.com>
2012-07-05 17:09:26 -07:00
Trae Robrock
2224767c4c Moving some logic that should fix the idle event
Signed-off-by: DTrejo <david.trejo@voxer.com>
2012-07-05 17:09:26 -07:00
DTrejo
b60e001fa0 hmset throws/errors out on non-string values. fixes #218 2012-06-04 16:13:56 -07:00
DTrejo
7734fb63b4 fix #222 hmset object expansion by @kartikrao 2012-06-04 13:43:10 -07:00
Matt Ranney
9e76387f59 Merge pull request #190 from bnoguchi/pub_sub_mode-fix
Pub sub mode fix
2012-04-29 17:56:01 -07:00
TEHEK Firefox
02b62e56bd Fix for [GH-165] - createClient to properly assign parser_module
Signed-off-by: David Trejo <david.daniel.trejo@gmail.com>
2012-04-27 13:41:42 -04:00
David Trejo
3b645c893d index.js: fix missing .EXEC alias 2012-04-27 13:35:14 -04:00
Brian Noguchi
64a0e68927 Add fix for last test (re-establish pub_sub_mode = true) 2012-03-12 23:03:46 -07:00
David Trejo
234ae6be9a Emit Error objects not strings 2012-03-05 17:29:54 -05:00
Matt Ranney
3a7c6388de Fix for [GH-93] - restore subscriptions, monitor, db, and auth on reconnect.
Also fixes bug with re-selecting db when auth is required.
Still needs a test for pub/sub reconnect and monitor reconnect.
2011-11-16 17:27:26 -10:00
Matt Ranney
faca4a8dc9 Bounds checking on Array expansion magic. 2011-11-16 12:10:19 -10:00
Matt Ranney
b9734d13eb Add socket_nodelay option to control Nagle. Fixes [GH-33] 2011-11-16 11:12:26 -10:00
Zachary Scott
c83c285213 remove double 'util' and 'Queue' from requires
ex: require('./lib/util').util;
2011-11-16 10:37:38 -10:00
Matt Ranney
edf46776a1 Merge remote-tracking branch 'dayananda/master'
Conflicts:
	index.js
2011-11-15 19:40:24 -10:00
Matt Ranney
69092a3f26 [GH-67] - hgetall now returns null instead of {} on empty reply 2011-11-15 15:21:49 -10:00
Matt Ranney
e39e8421bc Fix regression in reconnect logic.
Very much need automated tests for reconnection and queue logic.
2011-11-15 10:48:45 -10:00
Matt Ranney
29c408cbf1 Update TODO comment for retry thresholds. 2011-11-14 20:23:11 -10:00
Matt Ranney
dfd4c51b79 Merge pull request #136 from bobrik/callback-fixes
added ability to pass undefined instead of callback
2011-11-14 22:15:36 -08:00
Matt Ranney
6232d35993 Subscribe commands take optional callback. Fixes [GH-140]. 2011-11-13 21:01:15 -10:00
Matt Ranney
6a44331acd Fix this/self reference on db re-select. 2011-11-13 20:19:34 -10:00
Matt Ranney
dfcfaf3dc5 Fix style. 2011-11-13 20:12:22 -10:00
Matt Ranney
82cc930bc7 Merge pull request #142 from oxys/master
After a connection error, selected db, if it was set, is not restored
2011-11-13 21:57:32 -08:00
Matt Ranney
b633587b49 Fix flush+error bug on server disconnect.
Also assign a client ID to each client because stream.fd isn't available in node 0.6.
2011-11-13 18:11:28 -10:00
Matt Ranney
c74657cdfa Improved reconnect logic. Initial version of reconnect thresholds. 2011-11-10 13:09:39 -10:00
Owen Smith
54cf583dc3 Support new option 'max_attempts' to specify a total number of connection retries 2011-11-10 13:05:46 -10:00
Owen Smith
025c2e938e Support new option 'connect_timeout' to stop connection retries after the number of ms specified 2011-11-10 13:03:51 -10:00
Dayananda Nanjundappa
a6670edb9a Support for retrieving data as Buffer on a per command basis
This is achieved by introducing a new option to the createClient method called bufferedInput.
If bufferedInput is set to true, then the returned data will be a Buffer if the command argument passed is a buffer

E.g.
    var redis = require("redis"),
    client = redis.createClient(<port>, <host>, {buffered_input: true});

    client.set("foo_rand000000000000", "OK");

    // The below get request will return a utf8 string
    client.get("foo_rand000000000000", function (err, reply) {
        console.log(reply.toString()); // Will print `OK`
    });

    // The below get request will return a Buffer as the key is specified as a Buffer
    client.get(new Buffer("foo_rand000000000000"), function (err, reply) {
        console.log(reply.toString()); // Will print `<Buffer 4f 4b>`
    });
    client.end();
2011-11-03 16:32:47 +05:30
Jean-Hugues Pinson
074555396b override select method to store selected db in client instance and restore selected db on connect 2011-10-20 10:01:47 +02:00
Felix Geisendörfer
61ddce87fa Fix bad reference to 'this' 2011-10-19 14:48:01 +02:00
Ian Babrou
f30ecbe561 added ability to pass undefined instead of callback 2011-10-02 11:42:23 +04:00