mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-14 02:33:03 +02:00
fix(registry/consul): use health check option to control custom checks (#2391)
This commit is contained in:
parent
2d325fd386
commit
7866ff75fd
@ -132,6 +132,8 @@ func (c *Client) Register(_ context.Context, svc *registry.ServiceInstance, enab
|
||||
Timeout: "5s",
|
||||
})
|
||||
}
|
||||
// custom checks
|
||||
asr.Checks = append(asr.Checks, c.serviceChecks...)
|
||||
}
|
||||
if c.heartbeat {
|
||||
asr.Checks = append(asr.Checks, &api.AgentServiceCheck{
|
||||
@ -141,9 +143,6 @@ func (c *Client) Register(_ context.Context, svc *registry.ServiceInstance, enab
|
||||
})
|
||||
}
|
||||
|
||||
// custom checks
|
||||
asr.Checks = append(asr.Checks, c.serviceChecks...)
|
||||
|
||||
err := c.cli.Agent().ServiceRegister(asr)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user