querysub 0.107.0 → 0.108.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -275,7 +275,7 @@ async function getHTTPSKeyCertInner(callerIP: string) {
|
|
|
275
275
|
console.log(magenta(`Switching from local development to production development (removing A record for 127.0.0.1, and using a real ip)`));
|
|
276
276
|
promises.push(deleteRecord("A", edgeDomain, "127.0.0.1"));
|
|
277
277
|
}
|
|
278
|
-
promises.push(addRecord("A", edgeDomain, callerIP));
|
|
278
|
+
promises.push(addRecord("A", edgeDomain, callerIP, "proxied"));
|
|
279
279
|
runInfinitePoll(timeInMinute * 1, async () => {
|
|
280
280
|
let ips = await getRecords("A", edgeDomain);
|
|
281
281
|
if (!ips.includes(callerIP)) {
|
|
@@ -306,18 +306,29 @@ async function edgeNodeFunction(config: {
|
|
|
306
306
|
// We check multiple at a time, so a node being unresponsive doesn't cause lag
|
|
307
307
|
let PARALLEL_FACTOR = 3;
|
|
308
308
|
for (let i = 0; i < edgeNodes.length; i += PARALLEL_FACTOR) {
|
|
309
|
-
let
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
309
|
+
let node = await new Promise<EdgeNodeConfig | undefined>(resolve => {
|
|
310
|
+
for (let j = 0; j < PARALLEL_FACTOR; j++) {
|
|
311
|
+
let finished = 0;
|
|
312
|
+
((async () => {
|
|
313
|
+
try {
|
|
314
|
+
let node = edgeNodes[i + j];
|
|
315
|
+
if (!node) return;
|
|
316
|
+
let alive = await isNodeAlive(node);
|
|
317
|
+
if (alive) {
|
|
318
|
+
resolve(node);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
catch { }
|
|
322
|
+
finally {
|
|
323
|
+
finished++;
|
|
324
|
+
if (finished >= PARALLEL_FACTOR) {
|
|
325
|
+
resolve(undefined);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return undefined;
|
|
329
|
+
})()).catch(() => { });
|
|
330
|
+
}
|
|
331
|
+
});
|
|
321
332
|
if (node) {
|
|
322
333
|
return node;
|
|
323
334
|
}
|