querysub 0.292.0 → 0.293.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.292.0",
3
+ "version": "0.293.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",
@@ -10,7 +10,6 @@ import { delay, runInSerial, runInfinitePoll, runInfinitePollCallAtStart } from
10
10
  import { compare, compareArray, isNodeTrue, sort, timeInMinute } from "socket-function/src/misc";
11
11
  import { cacheLimited, lazy } from "socket-function/src/caching";
12
12
  import { canHaveChildren } from "socket-function/src/types";
13
- import { registerShutdownHandler, shutdown } from "../diagnostics/periodic";
14
13
  import { hostArchives } from "../-b-authorities/cdnAuthority";
15
14
  import { getModuleFromConfig } from "../3-path-functions/pathFunctionLoader";
16
15
  import path from "path";
@@ -26,7 +25,6 @@ import { onEdgeNodesChanged } from "./edgeBootstrap";
26
25
  import { startEdgeNotifier } from "./edgeClientWatcher";
27
26
  import { getGitRefLive, getGitURLLive } from "./git";
28
27
  import { DeployProgress } from "./deployFunctions";
29
- import { watchOnRollingUpdate } from "../deployManager/machineController";
30
28
 
31
29
  const UPDATE_POLL_INTERVAL = timeInMinute * 15;
32
30
  const DEAD_NODE_COUNT_THRESHOLD = 15;
@@ -89,8 +87,9 @@ export async function registerEdgeNode(config: {
89
87
  }
90
88
  registeredEdgeNode = true;
91
89
  let host = config.host;
90
+ await delay(0);
92
91
 
93
-
92
+ const { registerShutdownHandler } = await import("../diagnostics/periodic");
94
93
  registerShutdownHandler(async () => {
95
94
  edgeShutdown = true;
96
95
  console.log(magenta(`Removing node from edge node list due to shutdown`));
@@ -99,6 +98,7 @@ export async function registerEdgeNode(config: {
99
98
  }));
100
99
  await updateEdgeNodesFile();
101
100
  });
101
+ const { watchOnRollingUpdate } = await import("../deployManager/machineController");
102
102
  watchOnRollingUpdate({
103
103
  callback: async (time) => {
104
104
  let duration = time - Date.now();
@@ -290,6 +290,7 @@ async function updateEdgeNodesFile() {
290
290
  newEdgeNodeIndex.edgeNodes.push(edgeNodeConfig);
291
291
  }
292
292
 
293
+ console.log(magenta(`Updating ${edgeNodeIndexFile} with ${JSON.stringify(newEdgeNodeIndex)}`));
293
294
  await edgeNodeStorage.set(edgeNodeIndexFile, Buffer.from(JSON.stringify(newEdgeNodeIndex)));
294
295
  }
295
296