Ensure only one active attachment download setTimeout

This commit is contained in:
Scott Nonnenberg 2019-06-24 13:39:37 -07:00
parent ab2cc6ee53
commit cc4886caa5

View file

@ -110,6 +110,11 @@ async function addJob(attachment, job = {}) {
}
async function _tick() {
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
_maybeStartJob();
timeout = setTimeout(_tick, TICK_INTERVAL);
}