mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Housekeeping [skip ci]
This commit is contained in:
@@ -41,38 +41,36 @@ const deadDomains: string[] = [];
|
||||
const bar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
|
||||
bar.start(0, 0);
|
||||
|
||||
void Promise.all([
|
||||
await Promise.all([
|
||||
...domainRules,
|
||||
...domainSets
|
||||
].map(
|
||||
filepath => runAgainstSourceFile(
|
||||
filepath,
|
||||
(domain: string, includeAllSubdomain: boolean) => {
|
||||
bar.setTotal(bar.getTotal() + 1);
|
||||
].map(filepath => runAgainstSourceFile(
|
||||
filepath,
|
||||
(domain: string, includeAllSubdomain: boolean) => {
|
||||
bar.setTotal(bar.getTotal() + 1);
|
||||
|
||||
return queue.add(async () => {
|
||||
let registerableDomainAlive, registerableDomain, alive: boolean | undefined;
|
||||
return queue.add(async () => {
|
||||
let registerableDomainAlive, registerableDomain, alive: boolean | undefined;
|
||||
|
||||
if (includeAllSubdomain) {
|
||||
// we only need to check apex domain, because we don't know if there is any stripped subdomain
|
||||
({ alive: registerableDomainAlive, registerableDomain } = await isRegisterableDomainAlive(domain));
|
||||
} else {
|
||||
({ alive, registerableDomainAlive, registerableDomain } = await isDomainAlive(domain));
|
||||
if (includeAllSubdomain) {
|
||||
// we only need to check apex domain, because we don't know if there is any stripped subdomain
|
||||
({ alive: registerableDomainAlive, registerableDomain } = await isRegisterableDomainAlive(domain));
|
||||
} else {
|
||||
({ alive, registerableDomainAlive, registerableDomain } = await isDomainAlive(domain));
|
||||
}
|
||||
|
||||
bar.increment();
|
||||
|
||||
if (!registerableDomainAlive) {
|
||||
if (registerableDomain) {
|
||||
deadDomains.push('.' + registerableDomain);
|
||||
}
|
||||
|
||||
bar.increment();
|
||||
|
||||
if (!registerableDomainAlive) {
|
||||
if (registerableDomain) {
|
||||
deadDomains.push('.' + registerableDomain);
|
||||
}
|
||||
} else if (!includeAllSubdomain && alive != null && !alive) {
|
||||
deadDomains.push(domain);
|
||||
}
|
||||
});
|
||||
}
|
||||
).then(() => console.log('[crawl]', filepath))
|
||||
));
|
||||
} else if (!includeAllSubdomain && alive != null && !alive) {
|
||||
deadDomains.push(domain);
|
||||
}
|
||||
});
|
||||
}
|
||||
).then(() => console.log('[crawl]', filepath))));
|
||||
|
||||
await queue.done();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user