querysub 0.70.0 → 0.72.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
|
@@ -193,11 +193,16 @@ async function removeDeadARecords() {
|
|
|
193
193
|
// and it will be removed when we leave development
|
|
194
194
|
ips = ips.filter(ip => ip !== "127.0.0.1");
|
|
195
195
|
|
|
196
|
+
console.log(`Checking for dead records ${JSON.stringify(ips)}`);
|
|
197
|
+
|
|
196
198
|
let results = await Promise.all(ips.map(async ip => {
|
|
197
199
|
return await testTCPIsListening(ip, publicPort);
|
|
198
200
|
}));
|
|
199
201
|
|
|
200
202
|
let deadIPs = ips.filter((ip, i) => !results[i]);
|
|
203
|
+
if (deadIPs.length > 0) {
|
|
204
|
+
console.log(`Found dead IPs for ${edgeDomain}:${publicPort}, removing their A records: ${JSON.stringify(deadIPs)}`);
|
|
205
|
+
}
|
|
201
206
|
for (let deadIP of deadIPs) {
|
|
202
207
|
await deleteRecord("A", edgeDomain, deadIP);
|
|
203
208
|
}
|
|
@@ -209,7 +214,7 @@ async function getHTTPSKeyCertInner(callerIP: string) {
|
|
|
209
214
|
try {
|
|
210
215
|
let promises: Promise<void>[] = [];
|
|
211
216
|
let existingIPs = await getRecords("A", edgeDomain);
|
|
212
|
-
if (
|
|
217
|
+
if (!isPublic()) {
|
|
213
218
|
if (existingIPs.length === 0) {
|
|
214
219
|
promises.push(addRecord("A", edgeDomain, callerIP));
|
|
215
220
|
} else if (existingIPs.length === 1 && existingIPs[0] === "127.0.0.1") {
|
|
@@ -457,9 +457,7 @@ if (isServer()) {
|
|
|
457
457
|
// when using management tools to scan the DB (otherwise the entire DB has to go through
|
|
458
458
|
// our router, which can easily cap it at 15MB/s, because rogers is terrible).
|
|
459
459
|
// - Only if isNoNetwork, otherwise it causes unnecessary lag.
|
|
460
|
-
console.log(`Start isNoNetwork call at ${Date.now()}`);
|
|
461
460
|
let isNoNetwork = await NodeDiscoveryController.nodes[browserNodeId].isNoNetwork();
|
|
462
|
-
console.log(`End isNoNetwork call at ${Date.now()}`);
|
|
463
461
|
if (isNoNetwork && !location.search.includes("nolocalhost")) {
|
|
464
462
|
let url = new URL("https://" + browserNodeId);
|
|
465
463
|
url.hostname = "127-0-0-1." + url.hostname;
|
|
@@ -527,10 +525,7 @@ class NodeDiscoveryControllerBase {
|
|
|
527
525
|
return SocketFunction.mountedNodeId;
|
|
528
526
|
}
|
|
529
527
|
public async isNoNetwork() {
|
|
530
|
-
|
|
531
|
-
let result = isNoNetwork();
|
|
532
|
-
console.log(`End isNoNetwork call at ${Date.now()}`);
|
|
533
|
-
return result;
|
|
528
|
+
return isNoNetwork();
|
|
534
529
|
}
|
|
535
530
|
}
|
|
536
531
|
const NodeDiscoveryController = SocketFunction.register(
|