Commit f2603c82 authored by Arnout Kazemier's avatar Arnout Kazemier

Merge pull request #119 from 3rd-Eden/retries-race-condition

this.retries in IssueLog reaches negative value
parents 33155f1b 8292cdfb
......@@ -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