Skip to content

Commit

Permalink
🎨 Make use of exponent
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinroger committed Apr 13, 2017
1 parent 650150a commit 7c5e43f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/peer_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ PeerClient.prototype.generateBackoff = function(attempt) {
}

const random = parseInt(Math.random() * this.reconnect.maxRandomOffset);
const backoff = (Math.pow(2, attempt) * this.reconnect.min);
const backoff = (2 ** attempt * this.reconnect.min);
if (backoff > this.reconnect.max) {
return this.reconnect.max + random;
} else {
Expand Down

0 comments on commit 7c5e43f

Please sign in to comment.