Fixed options bug and proto indenting
This commit is contained in:
		| @@ -28,8 +28,10 @@ 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 | ||||||
|  | 	if req.Options != nil { | ||||||
| 		ttl := time.Duration(req.Options.Ttl) * time.Second | 		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...) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user