querysub 0.265.0 → 0.267.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
|
@@ -429,9 +429,8 @@ async function edgeNodeFunction(config: {
|
|
|
429
429
|
let host = edgeNodeConfig.host;
|
|
430
430
|
if (!host.endsWith("/")) host += "/";
|
|
431
431
|
for (let entryPath of edgeNodeConfig.entryPaths) {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}
|
|
432
|
+
// IMPORTANT! DO NOT REMOVE THE STARTING "/" FROM ENTRYPATH!
|
|
433
|
+
// The server needs it, because paths need 1 "/" to begin with, so two ("//") means require with "/", instead of requiring relative to the current directory!
|
|
435
434
|
await require("https://" + host + entryPath);
|
|
436
435
|
}
|
|
437
436
|
}
|
|
@@ -22,7 +22,7 @@ export function startEdgeNotifier() {
|
|
|
22
22
|
let liveHash = String(deploySchema()[getDomain()].deploy.live.hash);
|
|
23
23
|
if (!Querysub.isAllSynced()) return;
|
|
24
24
|
if (liveHash === lastHashServer) return;
|
|
25
|
-
let refreshThresholdTime = atomicObjectRead(deploySchema()[getDomain()].deploy.live.refreshThresholdTime) || timeInMinute;
|
|
25
|
+
let refreshThresholdTime = atomicObjectRead(deploySchema()[getDomain()].deploy.live.refreshThresholdTime) || (Date.now() + timeInMinute * 15);
|
|
26
26
|
lastHashServer = liveHash;
|
|
27
27
|
if (!curHash) {
|
|
28
28
|
curHash = liveHash;
|
|
@@ -64,6 +64,8 @@ function onLiveHashChange(liveHash: string, refreshThresholdTime: number) {
|
|
|
64
64
|
}
|
|
65
65
|
curHash = liveHash;
|
|
66
66
|
|
|
67
|
+
let duration = refreshThresholdTime - Date.now();
|
|
68
|
+
|
|
67
69
|
// Start notification loop
|
|
68
70
|
void (async () => {
|
|
69
71
|
// Show notifications at intervals
|
|
@@ -71,7 +73,7 @@ function onLiveHashChange(liveHash: string, refreshThresholdTime: number) {
|
|
|
71
73
|
// Don't show if a newer notification is active
|
|
72
74
|
if (curHash !== liveHash) return;
|
|
73
75
|
|
|
74
|
-
let waitDuration = (notifyIntervals[i + 1] - notifyIntervals[i]) *
|
|
76
|
+
let waitDuration = (notifyIntervals[i + 1] - notifyIntervals[i]) * duration;
|
|
75
77
|
// If the duration is short, and it's not the last one, skip it
|
|
76
78
|
if (i < notifyIntervals.length - 2 && waitDuration <= 30 * 1000) continue;
|
|
77
79
|
|
|
@@ -146,6 +146,7 @@ const loadEntryPointsByHash = runInSerial(async function loadEntryPointsByHash(c
|
|
|
146
146
|
FilePath: filePath,
|
|
147
147
|
FunctionId: "entryPoint",
|
|
148
148
|
});
|
|
149
|
+
console.log(magenta(`Loaded entry point from ${gitHash}, path: ${filePath}, resolved to ${module.filename}`));
|
|
149
150
|
|
|
150
151
|
let depth = entryPaths[0].replaceAll("\\", "/").split("/").filter(x => x && x !== ".").length;
|
|
151
152
|
|
|
@@ -133,7 +133,10 @@ type ServiceConfig = ${serviceConfigType}
|
|
|
133
133
|
onData: async (data: string) => {
|
|
134
134
|
Querysub.localCommit(() => {
|
|
135
135
|
let fullData = this.state.watchingOutputs[outputKey].data + data;
|
|
136
|
-
|
|
136
|
+
// Don't trim every time, otherwise the relative scroll position changes by too much
|
|
137
|
+
if (fullData.length > 1_000_000) {
|
|
138
|
+
fullData = fullData.slice(-100_000);
|
|
139
|
+
}
|
|
137
140
|
this.state.watchingOutputs[outputKey].data = fullData;
|
|
138
141
|
});
|
|
139
142
|
}
|