querysub 0.299.0 → 0.301.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
|
@@ -57,7 +57,7 @@ const notifyClients = throttleFunction(timeInMinute, async function notifyClient
|
|
|
57
57
|
let currentNotification: { close: () => void } | null = null;
|
|
58
58
|
let curHash = "";
|
|
59
59
|
function onLiveHashChange(liveHash: string, refreshThresholdTime: number) {
|
|
60
|
-
console.log(blue(`
|
|
60
|
+
console.log(blue(`Received client liveHash ${liveHash}, prev hash: ${curHash}`));
|
|
61
61
|
if (liveHash === curHash) return;
|
|
62
62
|
let prevHash = curHash;
|
|
63
63
|
// Don't notify the user right away. Hopefully they refresh naturally, and we never have to notify them at all!
|
|
@@ -125,9 +125,11 @@ function onLiveHashChange(liveHash: string, refreshThresholdTime: number) {
|
|
|
125
125
|
<button
|
|
126
126
|
className={css.pad(8, 16).hsl(200, 50, 50).color("white").pointer}
|
|
127
127
|
onClick={(e) => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
if (!liveHash.startsWith("forced")) {
|
|
129
|
+
Querysub.localCommit(() => {
|
|
130
|
+
liveHashOverrideURL.value = { liveHash, time: Date.now() };
|
|
131
|
+
});
|
|
132
|
+
}
|
|
131
133
|
window.location.reload();
|
|
132
134
|
}}
|
|
133
135
|
>
|
|
@@ -340,6 +340,13 @@ const runScreenCommand = measureWrap(async function runScreenCommand(config: {
|
|
|
340
340
|
if (rollingObj) {
|
|
341
341
|
rollingObj.pinnedDuration = config.rollingWindow;
|
|
342
342
|
}
|
|
343
|
+
// Without this check we might have only 1 service up for a long period of time. I guess even with it we can still have only 1 service up for a long period of time (if the rolling window is alive, but barely), but... idk... this seems better?
|
|
344
|
+
if (rollingObj && rollingObj.pinnedTime + rollingObj.pinnedDuration < Date.now()) {
|
|
345
|
+
console.log(red(`Rolling screen ${screenName} is finished, deleting it, it should be killed shortly`));
|
|
346
|
+
rollingKeepScreenAlive.delete(screenName);
|
|
347
|
+
rollingScreens.delete(rollingObj.rollingScreenName);
|
|
348
|
+
rollingObj = undefined;
|
|
349
|
+
}
|
|
343
350
|
let existingScreen = screens.find(x => x.screenName === screenName);
|
|
344
351
|
if (existingScreen && !rollingObj) {
|
|
345
352
|
let nodeIdPath = os.homedir() + "/" + SERVICE_FOLDER + screenName + "/" + SERVICE_NODE_FILE_NAME;
|