registry: rename context key "consul_register_tcp_check" to "consul_tcp_check"

This commit is contained in:
Shulhan 2018-03-21 21:57:04 +07:00
parent 65a90f5a21
commit 44b934d458
2 changed files with 2 additions and 2 deletions

View File

@ -32,6 +32,6 @@ func TCPCheck(t time.Duration) registry.Option {
if o.Context == nil {
o.Context = context.Background()
}
o.Context = context.WithValue(o.Context, "consul_register_tcp_check", t)
o.Context = context.WithValue(o.Context, "consul_tcp_check", t)
}
}

View File

@ -142,7 +142,7 @@ func (c *consulRegistry) Register(s *Service, opts ...RegisterOption) error {
}
if c.opts.Context != nil {
if tcpCheckInterval, ok := c.opts.Context.Value("consul_register_tcp_check").(time.Duration); ok {
if tcpCheckInterval, ok := c.opts.Context.Value("consul_tcp_check").(time.Duration); ok {
regTCPCheck = true
regInterval = tcpCheckInterval
}