Commit 8292cdfb authored by Ian Ward's avatar Ian Ward

add lock around registration of server retry

parent de44343e
......@@ -25,6 +25,7 @@ function IssueLog (args) {
this.config = args;
this.messages = [];
this.failed = false;
this.locked = false;
this.totalRetries = 0;
this.retry = 0;
......@@ -42,8 +43,8 @@ issues.log = function log (message) {
this.failed = true;
this.messages.push(message || 'No message specified');
if (this.retries) {
if (this.retries && !this.locked) {
this.locked = true;
setTimeout(issue.attemptRetry.bind(issue), this.retry);
return this.emit('issue', this.details);
}
......@@ -79,6 +80,7 @@ issues.attemptRetry = function attemptRetry () {
this.totalRetries++;
this.retries--;
this.failed = false;
this.locked = false;
};
issues.attemptReconnect = function attemptReconnect () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment