MCPcopy Create free account
hub / github.com/M-cheng-web/web-tracing / proxyAddCacheErrorA

Method proxyAddCacheErrorA

packages/core/src/lib/err-batch.ts:38–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 )
37 }
38 proxyAddCacheErrorA() {
39 let len = this.cacheErrorA.length
40 if (!len) return
41 const arr = groupArray(this.cacheErrorA, ...GROUPARRAYKEY)
42 const arrA = arr.filter(item => item.length < MAXLENGTHA)
43 const arrB = arr.filter(item => item.length >= MAXLENGTHA)
44
45 if (arrA.length) {
46 sendData.emit(arrA.flat(Infinity))
47 }
48 if (arrB.length) {
49 const arrBsum: any[] = []
50 arrB.forEach(item => {
51 const sumItem = item[0]
52 sumItem.batchError = true
53 sumItem.batchErrorLength = item.length
54 sumItem.batchErrorLastHappenTime = item[item.length - 1].triggerTime
55 arrBsum.push(sumItem)
56 })
57 this.cacheErrorB.push(...arrBsum)
58 this.throttleProxyAddCacheErrorB()
59 }
60
61 while (len--) {
62 this.cacheErrorA.shift()
63 }
64 }
65 proxyAddCacheErrorB() {
66 let len = this.cacheErrorB.length
67 if (!len) return

Callers 1

pushCacheErrorAMethod · 0.95

Calls 2

groupArrayFunction · 0.90
emitMethod · 0.80

Tested by

no test coverage detected