File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,14 @@ export class SentrySpanExporter {
126126

127127
/** Try to flush any pending spans immediately. */
128128
public flush(): void {
129-
const finishedSpans: ReadableSpan[] = this._finishedSpanBuckets.flatMap(bucket =>
130-
bucket ? Array.from(bucket.spans) : [],
131-
);
129+
const finishedSpans: ReadableSpan[] = [];
130+
for (const bucket of this._finishedSpanBuckets) {
131+
if (bucket) {
132+
for (const span of bucket.spans) {
133+
finishedSpans.push(span);
134+
}
135+
}
136+
}
132137

133138
this._flushSentSpanCache();
134139
const sentSpans = this._maybeSend(finishedSpans);

0 commit comments

Comments
 (0)