aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vendor/unique.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/vendor/unique.js b/vendor/unique.js
index f1f7425c..0a0e8072 100644
--- a/vendor/unique.js
+++ b/vendor/unique.js
@@ -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;
@@ -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 || {};
@@ -82,4 +85,4 @@ unique.exec = function (method, args, opts) {
}
};
-module.exports = unique; \ No newline at end of file
+module.exports = unique;