diff options
author | Florrie <towerofnix@gmail.com> | 2019-02-25 12:06:27 -0400 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2019-02-25 12:06:27 -0400 |
commit | e9ccfa2fd4221ddff4950d5180ee5c8fb0bf8117 (patch) | |
tree | 917fb878b8ba0166bb324f3781a756d516a639ca /general-util.js | |
parent | 75251bb2309505c20dc7500117a17649d41412d8 (diff) |
Metadata (stored, throttle, status, and more)
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) { |