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:
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 {
|
||||
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...)
|
||||
|
Loading…
Reference in New Issue
Block a user