querysub 0.420.0 → 0.422.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.420.0",
3
+ "version": "0.422.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",
@@ -338,7 +338,13 @@ export function createArchivesMemoryCache(
338
338
  // After merging, find the single entry that covers our aligned range
339
339
  let pathEntries = cacheByPath.get(path);
340
340
  if (!pathEntries) {
341
- throw new Error(`Expected cached entries for path ${path} after merge`);
341
+ console.error(`Expected cached entries for path ${path} after merge, reading range ${start}-${end}. Falling back to reading from the source.`);
342
+ let result = await archives.get(path, {
343
+ ...getConfig,
344
+ range: { start, end }
345
+ });
346
+ updateStats(false, result?.length);
347
+ return result;
342
348
  }
343
349
 
344
350
  let coveringEntry: CacheEntry | undefined = undefined;
@@ -337,10 +337,10 @@ export async function preloadUI(hash: string, progress?: DeployProgress) {
337
337
  let controller = EdgeNodeController.nodes[nodeId.nodeId];
338
338
  let section = `${nodeId.entryPoint}:${nodeId.nodeId}|Preloading UI`;
339
339
  progress?.({ section, progress: 0 });
340
- console.log(blue(`Preloading UI on ${String(nodeId)}, hash: ${hash}`));
340
+ console.log(blue(`Preloading UI on ${nodeId.nodeId}, hash: ${hash}`));
341
341
  await errorToUndefined(controller.preloadUI({ hash }));
342
342
  progress?.({ section, progress: 1 });
343
- console.log(blue(`Finished preloading UI on ${String(nodeId)}`));
343
+ console.log(blue(`Finished preloading UI on ${nodeId.nodeId}`));
344
344
  }));
345
345
  }
346
346
 
@@ -147,7 +147,8 @@ export async function moveLogsToPublic(config: {
147
147
  }));
148
148
  if (buffers.length === 0) continue;
149
149
 
150
- console.log(magenta(`Merging and moving ${group.length} log files backblaze (${blue(config.loggerName)})`));
150
+ let totalSize = buffers.reduce((acc, x) => acc + x.buffer.length, 0);
151
+ console.log(magenta(`Merging and moving ${group.length} log files (${formatNumber(totalSize)}B) backblaze (${blue(config.loggerName)})`));
151
152
 
152
153
  let allBuffers: Buffer[][] = [];
153
154
 
@@ -4,7 +4,7 @@ import { logErrors } from "../../../errors";
4
4
  import { IndexedLogs } from "./IndexedLogs";
5
5
 
6
6
  async function main() {
7
- IndexedLogs.runLogMoveLoop();
7
+ void IndexedLogs.runLogMoveLoop();
8
8
  }
9
9
 
10
10
  main().catch(logErrors);
@@ -54,17 +54,10 @@ export function getLogFile(obj: LogDatum) {
54
54
  logType = match[1];
55
55
  }
56
56
  }
57
- if (obj[LOG_LINE_LIMIT_ID]) {
58
- logType += "::" + String(obj[LOG_LINE_LIMIT_ID]);
59
- }
60
57
  return logType;
61
58
 
62
59
  }
63
- export const LOG_LIMIT_FLAG = String.fromCharCode(44533) + "LOGS_LIMITED_FLAG-9277640b-d709-4591-ab08-2bb29bbb94f4";
64
- export const LOG_LINE_LIMIT_FLAG = String.fromCharCode(44534) + "LOGS_LINE_LIMIT_FLAG-dd50ab1f-3021-45e3-82fc-d2702c7a64c8";
65
60
 
66
- /** If this key exists in the logged object, as in a key in one of the objects logged, then we will use the value of it as the limit ID. This is useful as it allows us to either override a limit or limit something independently from other logs in the file. */
67
- export const LOG_LINE_LIMIT_ID = "LIMIT_LINE_ID";
68
61
 
69
62
  let loggersObj: {
70
63
  logLogs: IndexedLogs<LogDatum>;
@@ -127,11 +120,6 @@ export function logDisk(type: "log" | "warn" | "info" | "error", ...args: unknow
127
120
  if (logObj.__FILE__) {
128
121
  logType = String(logObj.__FILE__);
129
122
  }
130
- let hasLineLimit = false;
131
- if (logObj[LOG_LINE_LIMIT_ID]) {
132
- logType += "::" + String(logObj[LOG_LINE_LIMIT_ID]);
133
- hasLineLimit = true;
134
- }
135
123
 
136
124
  // NOTE: Local logs now log to their local disk instead of backblaze, so we can log even if in development (they just won't show up on the remote server).
137
125
  //if (isPublic())
package/testEntry2.ts CHANGED
@@ -5,7 +5,6 @@ import { shutdown } from "./src/diagnostics/periodic";
5
5
  import { testTCPIsListening } from "socket-function/src/networking";
6
6
  import { Querysub } from "./src/4-querysub/QuerysubController";
7
7
  import { timeInSecond } from "socket-function/src/misc";
8
- import { LOG_LINE_LIMIT_ID } from "./src/diagnostics/logs/diskLogger";
9
8
  import { waitForFirstTimeSync } from "socket-function/time/trueTimeShim";
10
9
 
11
10
  export async function testMain() {