querysub 0.72.0 → 0.74.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
|
@@ -178,13 +178,13 @@ export async function publishMachineARecords() {
|
|
|
178
178
|
await setRecord("A", "*." + machineAddress, ip);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
runInfinitePoll(1000 * 60,
|
|
181
|
+
const runEdgeDomainAliveLoop = lazy(() => {
|
|
182
|
+
// NOTE: Our DNS TTL is 1 minute, which means no matter how fast we poll,
|
|
183
|
+
// we can't get below that. Of course the worst case is that + our poll rate,
|
|
184
|
+
// but still, this means there is less and less benefit the lower this value is.
|
|
185
|
+
runInfinitePoll(1000 * 60, checkEdgeDomainsAlive);
|
|
186
186
|
});
|
|
187
|
-
async function
|
|
187
|
+
async function checkEdgeDomainsAlive() {
|
|
188
188
|
if (isNoNetwork()) return;
|
|
189
189
|
if (publicPort === -1) return;
|
|
190
190
|
const edgeDomain = getDomain();
|
|
@@ -193,8 +193,6 @@ 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
|
-
|
|
198
196
|
let results = await Promise.all(ips.map(async ip => {
|
|
199
197
|
return await testTCPIsListening(ip, publicPort);
|
|
200
198
|
}));
|
|
@@ -209,6 +207,7 @@ async function removeDeadARecords() {
|
|
|
209
207
|
}
|
|
210
208
|
|
|
211
209
|
async function getHTTPSKeyCertInner(callerIP: string) {
|
|
210
|
+
runEdgeDomainAliveLoop();
|
|
212
211
|
const edgeDomain = getDomain();
|
|
213
212
|
if (callerIP) {
|
|
214
213
|
try {
|
package/src/server.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { deepCloneJSON, isBufferType, isNode, isNodeTrue } from "socket-function
|
|
|
5
5
|
import { SocketFunction } from "socket-function/SocketFunction";
|
|
6
6
|
import { getOwnMachineId, getThreadKeyCert } from "./-a-auth/certs";
|
|
7
7
|
import { logErrors } from "./errors";
|
|
8
|
-
import { publishMachineARecords
|
|
8
|
+
import { publishMachineARecords } from "./-e-certs/EdgeCertController";
|
|
9
9
|
import { getPathStr, getPathStr1, prependToPathStr, rootPathStr } from "./path";
|
|
10
10
|
import { authorityStorage, debugCoreMode, debugRejections, enableDebugRejections, pathValueArchives } from "./0-path-value-core/pathValueCore";
|
|
11
11
|
import { listenOnDebugger } from "./diagnostics/listenOnDebugger";
|
|
@@ -67,7 +67,5 @@ async function main() {
|
|
|
67
67
|
autoForwardPort: true,
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
verifyServicesAlive();
|
|
71
|
-
|
|
72
70
|
await publishMachineARecords();
|
|
73
71
|
}
|