From 43789890992f0cf00337c8ca1dab1187190f1589 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Mon, 5 May 2025 20:42:48 +0800 Subject: [PATCH] Chore: minor changes [skip ci] --- Build/validate-domain-alive.ts | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Build/validate-domain-alive.ts b/Build/validate-domain-alive.ts index 57266bce..a3b77193 100644 --- a/Build/validate-domain-alive.ts +++ b/Build/validate-domain-alive.ts @@ -34,18 +34,24 @@ function onDomain(args: [string, boolean]) { .crawl(SOURCE_DIR + path.sep + 'non_ip') .withPromise(); + const promises: Array> = []; + await Promise.all([ ...domainRules, ...domainSets - ].map(filepath => runAgainstSourceFile( - filepath, - (domain: string, includeAllSubdomain: boolean) => queue.add( - () => keyedAsyncMutexWithQueue( - domain, - () => isDomainAlive(domain, includeAllSubdomain) - ).then(onDomain) - ).then(() => console.log('[done]', filepath)) - ))); + ].map( + filepath => runAgainstSourceFile( + filepath, + (domain: string, includeAllSubdomain: boolean) => promises.push(queue.add( + () => keyedAsyncMutexWithQueue( + domain, + () => isDomainAlive(domain, includeAllSubdomain) + ).then(onDomain) + )) + ).then(() => console.log('[crawl]', filepath)) + )); + + await Promise.all(promises); console.log(); console.log();