From 93ab6424b0e5d1899af62f7977b37625dc330cf3 Mon Sep 17 00:00:00 2001 From: Rich Churcher Date: Fri, 12 Jan 2018 18:43:39 +1300 Subject: Reset startTime appropriately --- vendor/unique.js | 7 +++++-- 1 file 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; -- cgit v1.2.3