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

Method proxyAddCacheErrorB

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

Source from the content-addressed store, hash-verified

63 }
64 }
65 proxyAddCacheErrorB() {
66 let len = this.cacheErrorB.length
67 if (!len) return
68 const arr = groupArray(this.cacheErrorB, ...GROUPARRAYKEY)
69
70 while (len--) {
71 this.cacheErrorB.shift()
72 }
73
74 // 将区间报错合并
75 const emitList: any[] = []
76 arr.forEach((itemList: any[]) => {
77 const sumItem = itemList[0]
78 if (itemList.length > 1) {
79 sumItem.batchErrorLength = itemList.reduce(
80 (p, item) => (p += item.batchErrorLength),
81 0
82 )
83 sumItem.batchErrorLastHappenTime =
84 itemList[itemList.length - 1].triggerTime
85 }
86 emitList.push(sumItem)
87 })
88 sendData.emit(emitList)
89 }
90 /**
91 * 获取所有的错误
92 * 用户突然关闭页面时调用此方法集成错误

Callers 1

pushCacheErrorAMethod · 0.95

Calls 2

groupArrayFunction · 0.90
emitMethod · 0.80

Tested by

no test coverage detected