querysub 0.297.0 → 0.299.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
|
@@ -34,10 +34,7 @@ export function startEdgeNotifier() {
|
|
|
34
34
|
let { watchOnRollingUpdate } = await import("../deployManager/machineController");
|
|
35
35
|
watchOnRollingUpdate({
|
|
36
36
|
callback: (time) => {
|
|
37
|
-
|
|
38
|
-
// Refresh 10% earlier, as we don't want clients to refresh RIGHT when the server shutsdown...
|
|
39
|
-
time = Date.now() + duration * 0.9;
|
|
40
|
-
void notifyClients(lastHashServer, time);
|
|
37
|
+
void notifyClients(`forcedupdate-at-${time}`, time);
|
|
41
38
|
}
|
|
42
39
|
});
|
|
43
40
|
})();
|
|
@@ -45,9 +42,6 @@ export function startEdgeNotifier() {
|
|
|
45
42
|
|
|
46
43
|
let watchingClientNodes = new Set<string>();
|
|
47
44
|
const notifyClients = throttleFunction(timeInMinute, async function notifyClients(liveHash: string, refreshThresholdTime: number) {
|
|
48
|
-
// Wait, so the servers have time to load the new code. We tell the servers to preload but apparently there's some kind of lag, So we'll just delay here.
|
|
49
|
-
console.log(blue(`Waiting 30 seconds before notifying clients about liveHash ${liveHash}`));
|
|
50
|
-
await delay(30 * 1000);
|
|
51
45
|
console.log(blue(`Notifying ${watchingClientNodes.size} clients about liveHash ${liveHash}`));
|
|
52
46
|
await Promise.allSettled(Array.from(watchingClientNodes).map(async clientNodeId => {
|
|
53
47
|
try {
|
|
@@ -63,6 +57,7 @@ const notifyClients = throttleFunction(timeInMinute, async function notifyClient
|
|
|
63
57
|
let currentNotification: { close: () => void } | null = null;
|
|
64
58
|
let curHash = "";
|
|
65
59
|
function onLiveHashChange(liveHash: string, refreshThresholdTime: number) {
|
|
60
|
+
console.log(blue(`Client liveHash changed ${liveHash}, prev hash: ${curHash}`));
|
|
66
61
|
if (liveHash === curHash) return;
|
|
67
62
|
let prevHash = curHash;
|
|
68
63
|
// Don't notify the user right away. Hopefully they refresh naturally, and we never have to notify them at all!
|