浏览代码

Chore: minor changes [skip ci]

SukkaW 10 月之前
父节点
当前提交
4378989099
共有 1 个文件被更改,包括 15 次插入9 次删除
  1. 15 9
      Build/validate-domain-alive.ts

+ 15 - 9
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<Promise<void>> = [];
+
   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();