MCPcopy Create free account
hub / github.com/Eltaurus-Lt/CourseDump2022 / scanThread

Function scanThread

coursescan.js:540–562  ·  view source on GitHub ↗
(threadN, batch_size)

Source from the content-addressed store, hash-verified

538}
539
540async function scanThread(threadN, batch_size) {
541 let cidd;
542
543 while (cidd = cidds.pop()) {
544 if (cidd['domain'] === tabDomain) {
545 const closingEvent = await scanCourse(cidd, threadN);
546 if (closingEvent === "stopped") {
547 console.log(`thread ${threadN} (cid: ${cidd['cid']}) - scanning stopped by user`);
548 return "stopped";
549 };
550 if (closingEvent === "unauthorised") {
551 console.log(`thread ${threadN} (cid: ${cidd['cid']}) - user is not logged in, scanning terminated`);
552 return "unauthorised";
553 };
554 } else {
555 console.warn(`${cidd} does not match downloading tab domain ${tabDomain}`);
556 }
557 batch_done++;
558 updBatchProgress(batch_done, batch_size, cidd);
559 }
560
561 removeScanBar(threadN);
562}
563
564
565//batch scheduling

Callers 1

batchDownloadFunction · 0.85

Calls 3

scanCourseFunction · 0.85
updBatchProgressFunction · 0.85
removeScanBarFunction · 0.85

Tested by

no test coverage detected