querysub 0.25.0 → 0.27.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
|
@@ -169,7 +169,7 @@ export async function publishMachineARecords() {
|
|
|
169
169
|
// and not set public (such as the FunctionRunner). SO... just ignore this, leaving the records as
|
|
170
170
|
// public, even though the current run doesn't have public set.
|
|
171
171
|
if (process.argv[1].includes("server.ts")) {
|
|
172
|
-
console.log(yellow(`Current process is not marked as public, but machine previous had public services. NOT publishing A records to point to 127.0.0.1, which will make service inaccessible if the port is not forwarded open
|
|
172
|
+
console.log(yellow(`Current process is not marked as public, but machine previous had public services. NOT publishing A records to point to 127.0.0.1, which will make service inaccessible if the port is not port forwarded (or open). I recommend using noproxy.DOMAIN.com to access the server. 127-0-0-1.DOMAIN.com might work as well.`));
|
|
173
173
|
}
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
@@ -194,12 +194,11 @@ class NodePathAuthorities {
|
|
|
194
194
|
private async watchAuthorityPaths() {
|
|
195
195
|
await onNodeDiscoveryReady();
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
onReadReady = (nodeId, time) => {
|
|
198
198
|
let obj = this.authorities.get(nodeId);
|
|
199
199
|
if (!obj) {
|
|
200
|
-
//
|
|
201
|
-
|
|
202
|
-
// ingestNewNodeIds([nodeId], []);
|
|
200
|
+
// Might as well use this to add the node, if we don't know about it yet.
|
|
201
|
+
ingestNewNodeIds([nodeId], []);
|
|
203
202
|
return;
|
|
204
203
|
}
|
|
205
204
|
obj.isReadReady = time;
|
|
@@ -936,7 +935,7 @@ function authoritiesMightOverlap(other: AuthorityPath, current: AuthorityPath):
|
|
|
936
935
|
|
|
937
936
|
|
|
938
937
|
|
|
939
|
-
let
|
|
938
|
+
let onReadReady = (nodeId: string, time: number) => { };
|
|
940
939
|
class PathControllerBase {
|
|
941
940
|
public async getAuthorityPaths() {
|
|
942
941
|
return pathValueAuthority2.getSelfAuthorities();
|
|
@@ -953,7 +952,7 @@ class PathControllerBase {
|
|
|
953
952
|
public async broadcastReadReady(time: number) {
|
|
954
953
|
let nodeIdCaller = IdentityController_getCurrentReconnectNodeIdAssert();
|
|
955
954
|
console.log(magenta(`Received ready broadcast`), { nodeIdCaller });
|
|
956
|
-
|
|
955
|
+
onReadReady(nodeIdCaller, time);
|
|
957
956
|
}
|
|
958
957
|
}
|
|
959
958
|
const PathController = SocketFunction.register(
|
|
@@ -121,6 +121,8 @@ export function setGitURLMapping(config: {
|
|
|
121
121
|
gitURLRefMappings.set(getSpecKey(config.spec), config.resolvedPath);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
const loadTimeIndicatorFileName = "loadTimeIndicator-71cd93ba-1667-49ac-9206-b27930bbd983";
|
|
125
|
+
|
|
124
126
|
/** spec => path that we can use with require */
|
|
125
127
|
let moduleResolver = async (spec: FunctionSpec) => {
|
|
126
128
|
let gitURL = spec.gitURL;
|
|
@@ -145,24 +147,26 @@ let moduleResolver = async (spec: FunctionSpec) => {
|
|
|
145
147
|
const lockFolder = getSubFolder("synced_repos_locks");
|
|
146
148
|
let lockPath = lockFolder + sha256(repoPath).slice(0, 16) + ".loadinglock";
|
|
147
149
|
let exists = fs.existsSync(repoPath);
|
|
148
|
-
if (exists) {
|
|
149
|
-
|
|
150
|
-
exists = false;
|
|
151
|
-
}
|
|
150
|
+
if (exists && !fs.existsSync(repoPath + loadTimeIndicatorFileName)) {
|
|
151
|
+
exists = false;
|
|
152
152
|
}
|
|
153
153
|
if (!exists) {
|
|
154
154
|
await getFileLock(lockPath, async () => {
|
|
155
|
-
if (fs.existsSync(repoPath
|
|
156
|
-
|
|
155
|
+
if (fs.existsSync(repoPath + loadTimeIndicatorFileName)) return;
|
|
156
|
+
|
|
157
|
+
// Remove any previous attempt to sync it
|
|
158
|
+
if (fs.existsSync(repoPath)) {
|
|
157
159
|
await fs.promises.rename(repoPath, repoPath + "_" + Date.now());
|
|
158
160
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
// Clone it
|
|
162
|
+
await executeCommand("git", ["clone", gitURL, repoPath]);
|
|
163
|
+
await executeCommand("git", ["reset", "--hard", spec.gitRef], { cwd: repoPath });
|
|
164
|
+
|
|
165
|
+
// Yarn install
|
|
166
|
+
await executeCommand("yarn", ["install"], { cwd: repoPath });
|
|
167
|
+
|
|
168
|
+
// Mark it as loaded. If we don't reach this point we will move the folder and try again next time
|
|
169
|
+
await fs.promises.writeFile(repoPath + loadTimeIndicatorFileName, Date.now() + "");
|
|
166
170
|
});
|
|
167
171
|
}
|
|
168
172
|
|
|
@@ -220,15 +224,6 @@ async function getFileLock(file: string, callback: () => Promise<void>) {
|
|
|
220
224
|
}
|
|
221
225
|
}
|
|
222
226
|
|
|
223
|
-
async function isRepoCloned(path: string): Promise<boolean> {
|
|
224
|
-
try {
|
|
225
|
-
await executeCommand("git", ["-C", path, "rev-parse", "--is-inside-work-tree"]);
|
|
226
|
-
return true;
|
|
227
|
-
} catch {
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
227
|
export function isDynamicModule(module: NodeJS.Module): boolean {
|
|
233
228
|
return isDynamicModulePath(module.filename);
|
|
234
229
|
}
|
|
@@ -185,7 +185,7 @@ export class NodeViewer extends qreact.Component {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
let builtinGroups = {
|
|
188
|
-
"Default": ["buttons", "devToolsURL", "nodeId", "ip", "uptime", "loadTime", "Heap", "All Memory", "Blocking Lag", "port", "threadId", "machineId", "apiError", "live_entryPoint"],
|
|
188
|
+
"Default": ["buttons", "devToolsURL", "nodeId", "ip", "uptime", "loadTime", "Heap", "Buffers", "All Memory", "Blocking Lag", "port", "threadId", "machineId", "apiError", "live_entryPoint"],
|
|
189
189
|
};
|
|
190
190
|
// Column => group
|
|
191
191
|
let builtInGroupsLookup = new Map<string, string>();
|
|
@@ -85,7 +85,7 @@ function logResourcesNow() {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
registerMeasureInfo(() => {
|
|
88
|
-
return formatNumber(getHeapSize())
|
|
88
|
+
return `${formatNumber(getUsedHeapSize())}B+${formatNumber(getBufferUsage())}B/${formatNumber(getHeapSize())}B`;
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
registerPeriodic(logResourcesNow);
|