Skip to content

Commit

Permalink
控制3秒执行一次上传链路记录到FOPS中心
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Jan 10, 2024
1 parent aca7a32 commit 1edb19f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions saveTraceContextConsumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ import (
// FopsServer fops地址
var FopsServer string

// SaveTraceContextConsumer 上传到FOPS中心
// SaveTraceContextConsumer 上传链路记录到FOPS中心
func SaveTraceContextConsumer(subscribeName string, lstMessage collections.ListAny, remainingCount int) {
// 控制3秒执行一次
<-time.After(3 * time.Second)

trace.CurTraceContext.Get().Ignore()
lstTraceContext := collections.NewList[TraceContext]()
lstMessage.Foreach(func(item *any) {
Expand All @@ -31,8 +34,6 @@ func SaveTraceContextConsumer(subscribeName string, lstMessage collections.ListA
exception.ThrowRefuseException(err.Error())
}

// 控制3秒执行一次
<-time.After(3 * time.Second)
return
}

Expand Down

0 comments on commit 1edb19f

Please sign in to comment.