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')
|
.crawl(SOURCE_DIR + path.sep + 'non_ip')
|
||||||
.withPromise();
|
.withPromise();
|
||||||
|
|
||||||
|
const promises: Array<Promise<void>> = [];
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
...domainRules,
|
...domainRules,
|
||||||
...domainSets
|
...domainSets
|
||||||
].map(filepath => runAgainstSourceFile(
|
].map(
|
||||||
filepath,
|
filepath => runAgainstSourceFile(
|
||||||
(domain: string, includeAllSubdomain: boolean) => queue.add(
|
filepath,
|
||||||
() => keyedAsyncMutexWithQueue(
|
(domain: string, includeAllSubdomain: boolean) => promises.push(queue.add(
|
||||||
domain,
|
() => keyedAsyncMutexWithQueue(
|
||||||
() => isDomainAlive(domain, includeAllSubdomain)
|
domain,
|
||||||
).then(onDomain)
|
() => isDomainAlive(domain, includeAllSubdomain)
|
||||||
).then(() => console.log('[done]', filepath))
|
).then(onDomain)
|
||||||
)));
|
))
|
||||||
|
).then(() => console.log('[crawl]', filepath))
|
||||||
|
));
|
||||||
|
|
||||||
|
await Promise.all(promises);
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
console.log();
|
console.log();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user