Permalink
Browse files

Changed backoffmax to something less geological, time-wise.

  • Loading branch information...
1 parent f2d0bfe commit ef733087810f8b40caed750dd71fbb21aa0ea1f5 @jeremycx committed Sep 17, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 LDAP.js
View
@@ -46,8 +46,8 @@ var LDAP = function(opts) {
}
opts.timeout = opts.timeout || 5000;
- opts.backoff = -1;
- opts.backoffmax = opts.backoffmax || 30000;
+ opts.backoff = 1; //sec
+ opts.backoffmax = opts.backoffmax || 32; //sec
self.BASE = 0;
self.ONELEVEL = 1;
@@ -117,7 +117,7 @@ var LDAP = function(opts) {
function backoff() {
stats.backoffs++;
- opts.backoff++;
+ opts.backoff *= 2;
if (opts.backoff > opts.backoffmax)
opts.backoff = opts.backoffmax;
return opts.backoff * 1000;
@@ -132,7 +132,7 @@ var LDAP = function(opts) {
reconnect();
} else {
stats.reconnects++;
- opts.backoff = -1;
+ opts.backoff = 1;
replayCallbacks();
reconnecting = false;

0 comments on commit ef73308

Please sign in to comment.