1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00

Set registry TTL to seconds, not the nanoseconds

This commit is contained in:
Milos Gajdos 2019-09-27 15:00:25 +01:00
parent d85ca7abd2
commit 8417361bce

View File

@ -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 {
var regOpts []registry.RegisterOption
ttl := time.Duration(req.Options.Ttl)
ttl := time.Duration(req.Options.Ttl) * time.Second
regOpts = append(regOpts, registry.RegisterTTL(ttl))
err := r.Registry.Register(service.ToService(req), regOpts...)