mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
Chore: minor changes [skip ci]
This commit is contained in:
parent
fe5924f141
commit
4378989099
@ -34,18 +34,24 @@ function onDomain(args: [string, boolean]) {
|
||||
.crawl(SOURCE_DIR + path.sep + 'non_ip')
|
||||
.withPromise();
|
||||
|
||||
const promises: Array<Promise<void>> = [];
|
||||
|
||||
await Promise.all([
|
||||
...domainRules,
|
||||
...domainSets
|
||||
].map(filepath => runAgainstSourceFile(
|
||||
].map(
|
||||
filepath => runAgainstSourceFile(
|
||||
filepath,
|
||||
(domain: string, includeAllSubdomain: boolean) => queue.add(
|
||||
(domain: string, includeAllSubdomain: boolean) => promises.push(queue.add(
|
||||
() => keyedAsyncMutexWithQueue(
|
||||
domain,
|
||||
() => isDomainAlive(domain, includeAllSubdomain)
|
||||
).then(onDomain)
|
||||
).then(() => console.log('[done]', filepath))
|
||||
)));
|
||||
))
|
||||
).then(() => console.log('[crawl]', filepath))
|
||||
));
|
||||
|
||||
await Promise.all(promises);
|
||||
|
||||
console.log();
|
||||
console.log();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user