From d3181ddafe6b806f8d46983b4ff8aaaa6b2657f3 Mon Sep 17 00:00:00 2001 From: Mostafa Samir Date: Fri, 1 Apr 2016 20:26:26 +0200 Subject: [PATCH] removed seemingly unnecessary resetRetriesCheck function the function being set to fire after 100ms conflicted with delays in firing the 'disconnect' event on windows, and this resulted in the socket's 'retriesRemianing' being reset after every decrement and thus violatin the 'maxRetries' rule --- dao/client.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/dao/client.js b/dao/client.js index f1e0f08..7bba655 100644 --- a/dao/client.js +++ b/dao/client.js @@ -160,21 +160,10 @@ function connect(){ return; } - client.isRetrying=true; - setTimeout( function retryTimeout(){ client.retriesRemaining--; - client.isRetrying=false; client.connect(); - setTimeout( - function resetRetriesCheck(){ - if(!client.isRetrying){ - client.retriesRemaining=client.config.maxRetries; - } - }, - 100 - ); }.bind(null,client), client.config.retry );