Set registry TTL to seconds, not the nanoseconds
This commit is contained in:
parent
d85ca7abd2
commit
8417361bce
@ -28,7 +28,7 @@ func (r *Registry) GetService(ctx context.Context, req *pb.GetRequest, rsp *pb.G
|
|||||||
|
|
||||||
func (r *Registry) Register(ctx context.Context, req *pb.Service, rsp *pb.EmptyResponse) error {
|
func (r *Registry) Register(ctx context.Context, req *pb.Service, rsp *pb.EmptyResponse) error {
|
||||||
var regOpts []registry.RegisterOption
|
var regOpts []registry.RegisterOption
|
||||||
ttl := time.Duration(req.Options.Ttl)
|
ttl := time.Duration(req.Options.Ttl) * time.Second
|
||||||
regOpts = append(regOpts, registry.RegisterTTL(ttl))
|
regOpts = append(regOpts, registry.RegisterTTL(ttl))
|
||||||
|
|
||||||
err := r.Registry.Register(service.ToService(req), regOpts...)
|
err := r.Registry.Register(service.ToService(req), regOpts...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user