Skip to content

Commit

Permalink
fix: goroutine id
Browse files Browse the repository at this point in the history
  • Loading branch information
3ks committed Oct 25, 2020
1 parent 736a691 commit beaeb75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/producer/performance_test_demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func main() {
producerInstance.Start()
fmt.Println("start send logs")
for i := 0; i < 10; i++ {
go func() {
go func(id int) {
for i := 0; i < 200000000; i++ {
r := rand.Intn(200000000)
err := producerInstance.SendLog("project", "logstore", generateTopic(r), generateSource(r), getLog(keys))
Expand All @@ -41,8 +41,8 @@ func main() {
break
}
}
fmt.Println("All data in the queue has been sent, groutine id:", i)
}()
fmt.Println("All data in the queue has been sent, goroutine id:", id)
}(i)
}
if _, ok := <-ch; ok {
fmt.Println("Get the shutdown signal and start to shut down")
Expand Down

0 comments on commit beaeb75

Please sign in to comment.