@sentio/runtime 2.59.0-rc.37 → 2.59.0-rc.38
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/lib/index.js
CHANGED
package/lib/processor-runner.js
CHANGED
package/lib/service-worker.js
CHANGED
package/package.json
CHANGED
package/src/utils.ts
CHANGED
@@ -19,11 +19,13 @@ export function mergeProcessResultsInPlace(
|
|
19
19
|
): Required<ProcessResult, 'states'> {
|
20
20
|
res.states = res.states || StateResult.create()
|
21
21
|
for (const r of results) {
|
22
|
-
|
23
|
-
|
24
|
-
res.
|
25
|
-
res.
|
26
|
-
res.
|
22
|
+
// not using spread operator since it puts all element on the stack
|
23
|
+
// cause maximum call stack size exceeded error if it's a large array
|
24
|
+
mergeArrayInPlace(res.counters, r.counters)
|
25
|
+
mergeArrayInPlace(res.gauges, r.gauges)
|
26
|
+
mergeArrayInPlace(res.events, r.events)
|
27
|
+
mergeArrayInPlace(res.exports, r.exports)
|
28
|
+
mergeArrayInPlace(res.timeseriesResult, r.timeseriesResult)
|
27
29
|
res.states = {
|
28
30
|
configUpdated: res.states?.configUpdated || r.states?.configUpdated || false
|
29
31
|
}
|
@@ -31,6 +33,12 @@ export function mergeProcessResultsInPlace(
|
|
31
33
|
return res
|
32
34
|
}
|
33
35
|
|
36
|
+
function mergeArrayInPlace<T>(dst: T[], src: T[]) {
|
37
|
+
for (const r of src) {
|
38
|
+
dst.push(r)
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
34
42
|
export function errorString(e: Error): string {
|
35
43
|
return e.message + '\n' + e.stack
|
36
44
|
}
|