Permalink
Browse files

Formatting

  • Loading branch information...
1 parent 38dbaca commit 0698a5e627a2396ba768650665e115443e46f921 @tomaszdurka tomaszdurka committed Mar 17, 2013
Showing with 28 additions and 28 deletions.
  1. +9 −9 index.js
  2. +19 −19 test.js
View
@@ -55,10 +55,10 @@ function RedisClient(stream, options) {
if (typeof this.options.enable_offline_queue === "boolean") {
this.enable_offline_queue = this.options.enable_offline_queue;
}
- this.retry_max_delay = null;
- if (options.retry_max_delay !== undefined && !isNaN(options.retry_max_delay) && options.retry_max_delay > 0) {
- this.retry_max_delay = options.retry_max_delay;
- }
+ this.retry_max_delay = null;
+ if (options.retry_max_delay !== undefined && !isNaN(options.retry_max_delay) && options.retry_max_delay > 0) {
+ this.retry_max_delay = options.retry_max_delay;
+ }
this.initialize_retry_vars();
this.pub_sub_mode = false;
@@ -432,11 +432,11 @@ RedisClient.prototype.connection_gone = function (why) {
return;
}
- if (this.retry_max_delay !== null && this.retry_delay > this.retry_max_delay) {
- this.retry_delay = this.retry_max_delay;
- } else {
- this.retry_delay = Math.floor(this.retry_delay * this.retry_backoff);
- }
+ if (this.retry_max_delay !== null && this.retry_delay > this.retry_max_delay) {
+ this.retry_delay = this.retry_max_delay;
+ } else {
+ this.retry_delay = Math.floor(this.retry_delay * this.retry_backoff);
+ }
if (exports.debug_mode) {
console.log("Retry connection in " + this.retry_delay + " ms");
View
@@ -1799,25 +1799,25 @@ tests.auth = function () {
};
tests.reconnectRetryMaxDelay = function() {
- var time = new Date().getTime(),
- name = 'reconnectRetryMaxDelay',
- reconnecting = false;
- var client = redis.createClient(PORT, HOST, {
- retry_max_delay: 1
- });
- client.on('ready', function() {
- if (!reconnecting) {
- reconnecting = true;
- client.retry_delay = 1000;
- client.retry_backoff = 1;
- client.stream.end();
- } else {
- client.end();
- var lasted = new Date().getTime() - time;
- assert.ok(lasted < 1000);
- next(name);
- }
- });
+ var time = new Date().getTime(),
+ name = 'reconnectRetryMaxDelay',
+ reconnecting = false;
+ var client = redis.createClient(PORT, HOST, {
+ retry_max_delay: 1
+ });
+ client.on('ready', function() {
+ if (!reconnecting) {
+ reconnecting = true;
+ client.retry_delay = 1000;
+ client.retry_backoff = 1;
+ client.stream.end();
+ } else {
+ client.end();
+ var lasted = new Date().getTime() - time;
+ assert.ok(lasted < 1000);
+ next(name);
+ }
+ });
};
all_tests = Object.keys(tests);

0 comments on commit 0698a5e

Please sign in to comment.