MCPcopy Create free account
hub / github.com/error311/FileRise / runQueue

Function runQueue

public/js/sharedDropView.js:566–584  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

564 }
565
566 function runQueue() {
567 while (running < MAX_CONCURRENT) {
568 const next = queue.find((q) => q.status === 'queued');
569 if (!next) break;
570 running += 1;
571 setItemStatus(next, 'uploading', 0, tx('share_uploading_progress', { pct: 0 }, 'Uploading 0%'));
572 uploadItem(next)
573 .catch((err) => {
574 const msg = err && err.message ? err.message : tx('share_upload_failed', null, 'Upload failed.');
575 const statusCode = (err && Number.isFinite(err.status)) ? Number(err.status) : 0;
576 setItemStatus(next, 'error', next.progress || 0, msg);
577 showDropUploadError(msg, statusCode);
578 })
579 .finally(() => {
580 running -= 1;
581 runQueue();
582 });
583 }
584 }
585
586 function enqueueFiles(items) {
587 if (!Array.isArray(items) || !items.length) return;

Callers 1

enqueueFilesFunction · 0.85

Calls 4

setItemStatusFunction · 0.85
uploadItemFunction · 0.85
showDropUploadErrorFunction · 0.85
txFunction · 0.70

Tested by

no test coverage detected