scraped = {
button;
let alive = true;
invalidation.then(() => {
alive = false;
});
const allPlans = [];
const college = "RE";
top: for (const [i, department] of searchControls.departments.entries()) {
await Promises.delay(250);
const majors = await getMajors(2020, college, department.code);
for (const [k, major] of majors.entries()) {
if (!alive) break top;
await Promises.delay(250);
const plans = await getPlans(2020, college, major.major_code);
console.log(
`[${i + 1}/${searchControls.departments.length}]`,
` [${k + 1}/${majors.length}]`,
plans
);
for (const plan of plans) {
allPlans.push(plan);
}
}
}
return { finished: alive, data: allPlans };
}