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
1 changed files with 5 additions and 0 deletions

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);
}