Browse Source

Fix this/self reference on db re-select.

gh-pages
Matt Ranney 13 years ago
parent
commit
6a44331acd
  1. 4
      index.js
  2. 17
      tests/test_start_stop.js

4
index.js

@ -166,8 +166,8 @@ RedisClient.prototype.do_auth = function () {
} }
// restore the selected db if needed // restore the selected db if needed
if (this.selected_db !== null) { if (self.selected_db !== null) {
this.send_command('select', [this.selected_db]); self.send_command('select', [self.selected_db]);
} }
// now we are really connected // now we are really connected

17
tests/test_start_stop.js

@ -1,17 +0,0 @@
var redis = require("./index"),
client = redis.createClient();
// This currently doesn't work, due to what I beleive to be a bug in redis 2.0.1.
// INFO and QUIT are pipelined together, and the socket closes before the INFO
// command gets a reply.
redis.debug_mode = true;
client.info(redis.print);
client.quit();
// A workaround is:
// client.info(function (err, res) {
// console.log(res.toString());
// client.quit();
// });
Loading…
Cancel
Save