Skip to content

Commit df3b0b0

Browse files
committed
fix: request interval
1 parent 4ae274a commit df3b0b0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mse-go-quickstart-demo/RequestSender/go.sum

Whitespace-only changes.

mse-go-quickstart-demo/RequestSender/main.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ func doHttpRequest() {
2828
Timeout: 5 * time.Second,
2929
}
3030
for {
31+
randN := rand.Intn(100)
32+
time.Sleep(time.Duration(randN) * time.Millisecond)
33+
3134
targetDomain := "mse-go-demo-a"
3235
lbDomain := os.Getenv("MSE_GATEWAY_DOMAIN")
3336
if lbDomain != "" {
@@ -40,7 +43,6 @@ func doHttpRequest() {
4043
continue
4144
}
4245

43-
randN := rand.Intn(100)
4446
if randN > 50 {
4547
req.Header.Set("x-mse-tag", "gray")
4648
}
@@ -56,6 +58,5 @@ func doHttpRequest() {
5658
}
5759

5860
fmt.Printf("doHttpRequest do request success, resp is %v\n", resp)
59-
time.Sleep(time.Duration(randN) * time.Millisecond)
6061
}
6162
}

0 commit comments

Comments
 (0)