fix(scan): 修正 SubmitPool 中的上下文传递问题
- 将 SubmitPool 协程中的上下文参数从 ctx 替换为 context.Background() - 确保追踪跨度的上下文独立于父上下文,避免潜在的并发问题 - 优化了链路追踪的上下文管理逻辑
This commit is contained in:
@@ -290,7 +290,7 @@ func (c *ScanController) Scan() {
|
||||
}
|
||||
|
||||
submitPool.Go(func() {
|
||||
ctx2, span2 := otelTrace.CreateLinkContext(ctx, "ScanController.SubmitPool")
|
||||
ctx2, span2 := otelTrace.CreateLinkContext(context.Background(), "ScanController.SubmitPool")
|
||||
defer span2.End()
|
||||
span2.SetAttributes(attribute.String("bankOrderId", orderInfo.BankOrderId))
|
||||
span2.AddEvent("StartScan")
|
||||
|
||||
Reference in New Issue
Block a user