querysub 0.77.0 → 0.79.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "querysub",
3
- "version": "0.77.0",
3
+ "version": "0.79.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
@@ -200,7 +200,14 @@ async function checkEdgeDomainsAlive() {
200
200
  ips = ips.filter(ip => ip !== "127.0.0.1");
201
201
 
202
202
  let results = await Promise.all(ips.map(async ip => {
203
- return await testTCPIsListening(ip, publicPort);
203
+ // It must be not listening for 3 times in a row
204
+ for (let i = 0; i < 3; i++) {
205
+ let isListening = await testTCPIsListening(ip, publicPort);
206
+ if (isListening) return true;
207
+ console.warn(`IP ${ip}:${publicPort} is not listening, waiting 10 seconds before retrying`);
208
+ await delay(timeInSecond * 10);
209
+ }
210
+ return false;
204
211
  }));
205
212
 
206
213
  let deadIPs = ips.filter((ip, i) => !results[i]);
@@ -264,7 +271,7 @@ async function getHTTPSKeyCertInner(callerIP: string) {
264
271
  promises.push(deleteRecord("A", edgeDomain, "127.0.0.1"));
265
272
  }
266
273
  promises.push(addRecord("A", edgeDomain, callerIP));
267
- runInfinitePoll(timeInMinute * 5, async () => {
274
+ runInfinitePoll(timeInMinute * 1, async () => {
268
275
  let ips = await getRecords("A", edgeDomain);
269
276
  if (!ips.includes(callerIP)) {
270
277
  console.error(`Our A record for ${edgeDomain} is no longer pointing to our ip (${callerIP}, as it is now pointing to ${JSON.stringify(ips)}). Terminating, hopefully when we restart we will fix it. This SHOULDN'T happen often!`);