diff options
Diffstat (limited to 'general-util.js')
-rw-r--r-- | general-util.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/general-util.js b/general-util.js index 708e150..a7bfb11 100644 --- a/general-util.js +++ b/general-util.js @@ -111,7 +111,7 @@ module.exports.throttlePromise = function(maximumAtOneTime = 10) { }) } - return function(callback) { + const enqueue = function(callback) { if (activeCount >= maximumAtOneTime) { return new Promise((resolve, reject) => { queue.push(function() { @@ -122,6 +122,10 @@ module.exports.throttlePromise = function(maximumAtOneTime = 10) { return execute(callback) } } + + enqueue.queue = queue + + return enqueue } module.exports.getTimeStringsFromSec = function(curSecTotal, lenSecTotal) { |