Skip to content

Commit 4626e73

Browse files
fix(txm): fixed infinite traces
1 parent ea7ad97 commit 4626e73

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/txm/lib/BlockMonitor.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { LogTag, Logger } from "@happy.tech/common"
2-
import { SpanStatusCode, context, trace } from "@opentelemetry/api"
2+
import { ROOT_CONTEXT, SpanStatusCode, context, trace } from "@opentelemetry/api"
33
import type { Block } from "viem"
44
import { Topics, eventBus } from "./EventBus.js"
55
import type { TransactionManager } from "./TransactionManager.js"
@@ -86,6 +86,10 @@ export class BlockMonitor {
8686
this.unwatch = undefined
8787
}
8888

89-
setTimeout(() => this.start(), 500)
89+
setTimeout(() => {
90+
context.with(ROOT_CONTEXT, () => {
91+
this.start()
92+
})
93+
}, 500)
9094
}
9195
}

0 commit comments

Comments
 (0)