Skip to content

Commit

Permalink
Merge pull request #596 from richchurcher/master
Browse files Browse the repository at this point in the history
[fix] Reset unique startTime appropriately
  • Loading branch information
Marak authored Sep 23, 2018
2 parents 65609e4 + 93ab642 commit 07f39bd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vendor/unique.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var maxTime = 5000;
var maxRetries = 50;

// time the script started
var startTime = new Date().getTime();
var startTime = null;

// current iteration or retries of unique.exec ( current loop depth )
var currentIterations = 0;
Expand All @@ -41,6 +41,9 @@ unique.errorMessage = function (now, code) {

unique.exec = function (method, args, opts) {

if (currentIterations === 0) {
startTime = new Date().getTime();
}
var now = new Date().getTime();

opts = opts || {};
Expand Down Expand Up @@ -82,4 +85,4 @@ unique.exec = function (method, args, opts) {
}
};

module.exports = unique;
module.exports = unique;

0 comments on commit 07f39bd

Please sign in to comment.