socket-function 0.12.2 → 0.12.3
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
package/src/CallFactory.ts
CHANGED
|
@@ -16,7 +16,10 @@ import pako from "pako";
|
|
|
16
16
|
import { setFlag } from "../require/compileFlags";
|
|
17
17
|
setFlag(require, "pako", "allowclient", true);
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
// NOTE: If it is too low, and too many servers disconnect, we can easily spend 100% of our time
|
|
20
|
+
// trying to reconnect.
|
|
21
|
+
// (Or... maybe the delay is just waiting, and we aren't actually overloading the server?)
|
|
22
|
+
const MIN_RETRY_DELAY = 5000;
|
|
20
23
|
|
|
21
24
|
type InternalCallType = FullCallType & {
|
|
22
25
|
seqNum: number;
|
|
@@ -91,7 +91,11 @@ export class JSONLACKS {
|
|
|
91
91
|
if (extendedParsing) {
|
|
92
92
|
obj = measureBlock(function JSONextendedParse() { return parser.parse(text); });
|
|
93
93
|
} else {
|
|
94
|
-
|
|
94
|
+
try {
|
|
95
|
+
obj = measureBlock(function JSONparse() { return JSON.parse(text); });
|
|
96
|
+
} catch {
|
|
97
|
+
obj = measureBlock(function JSONextendedParse() { return parser.parse(text); });
|
|
98
|
+
}
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
return JSONLACKS.hydrateSpecialObjects(obj, hydrateState, config) as T;
|
package/src/profiling/measure.ts
CHANGED
|
@@ -178,7 +178,8 @@ export function logMeasureTable(
|
|
|
178
178
|
title += extraInfos.map(x => x ? ` // ${x}` : "").join("");
|
|
179
179
|
process.stdout.write(`\x1b]0;${title}\x07`);
|
|
180
180
|
}
|
|
181
|
-
let
|
|
181
|
+
let pid = isNode() ? `(${process.pid}) ` : "";
|
|
182
|
+
let title = yellow(`${pid}Profiled ${formatTime(totalTime)} (${percent(fraction)} CPU)${extraInfos.map(x => x ? ` (${x})` : "")} (logged at ${new Date().toISOString()}, profile for ${formatTime(timeRunFor)})`);
|
|
182
183
|
if (name) {
|
|
183
184
|
title = `(${blue(name)}) ${title}`;
|
|
184
185
|
}
|