Pass ctx correctly

This commit is contained in:
Fangliding
2026-08-08 13:07:09 +08:00
parent 6e3322d219
commit a591870b44
+2 -2
View File
@@ -172,13 +172,13 @@ func (h *HealthPing) doCheck(ctx context.Context, tags []string, duration time.D
for _, tag := range tags { for _, tag := range tags {
handler := tag handler := tag
client := newPingClient( client := newPingClient(
h.ctx, ctx,
h.dispatcher, h.dispatcher,
h.Settings.Destination, h.Settings.Destination,
h.Settings.Timeout, h.Settings.Timeout,
handler, handler,
) )
for i := 0; i < rounds; i++ { for range rounds {
delay := time.Duration(0) delay := time.Duration(0)
if duration > 0 { if duration > 0 {
delay = time.Duration(dice.RollInt63n(int64(duration))) delay = time.Duration(dice.RollInt63n(int64(duration)))