@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
@@ -29,7 +29,7 @@ import {
29
29
  providerMetrics,
30
30
  recordRuntimeInfo,
31
31
  timeoutError
32
- } from "./chunk-NVQB62KF.js";
32
+ } from "./chunk-C4IDZGJI.js";
33
33
  import {
34
34
  Plugin,
35
35
  PluginManager
@@ -44,7 +44,7 @@ import {
44
44
  require_lodash,
45
45
  require_src,
46
46
  trace
47
- } from "./chunk-NVQB62KF.js";
47
+ } from "./chunk-C4IDZGJI.js";
48
48
  import {
49
49
  ExecutionConfig,
50
50
  HandlerType,
@@ -10,7 +10,7 @@ import {
10
10
  recordRuntimeInfo,
11
11
  require_lib3 as require_lib,
12
12
  require_lib4 as require_lib2
13
- } from "./chunk-NVQB62KF.js";
13
+ } from "./chunk-C4IDZGJI.js";
14
14
  import {
15
15
  PluginManager,
16
16
  ProcessConfigResponse,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
- "version": "2.59.0-rc.37",
3
+ "version": "2.59.0-rc.38",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
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
- res.counters.push(...r.counters)
23
- res.gauges.push(...r.gauges)
24
- res.events.push(...r.events)
25
- res.exports.push(...r.exports)
26
- res.timeseriesResult.push(...r.timeseriesResult)
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
  }