fix: change timer to ticker for improved periodic execution

This commit is contained in:
withchao 2026-07-03 16:28:20 +08:00
parent 26e22efdd8
commit fa411a79a4

View File

@ -489,7 +489,7 @@ func startRedisServerRegister(ctx context.Context, cfg *serverConfig, client dis
log.ZWarn(ctx, "gateway register failed", err, "address", selfAddr)
}
}
timer := time.NewTimer(validTime / 2)
timer := time.NewTicker(validTime / 2)
defer func() {
timer.Stop()
ctx, cancel := context.WithTimeout(context.WithoutCancel(ctx), time.Second)