Skip to content

Commit

Permalink
Check failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
iegomez committed May 24, 2023
1 parent 097cf31 commit c9355ba
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions backends/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type GRPC struct {
dialOptions []grpc.DialOption
hostname string
timeout int
name string
}

const defaultGRPCTimeoutMs = 500
Expand Down Expand Up @@ -76,8 +75,6 @@ func NewGRPC(authOpts map[string]string, logLevel log.Level) (*GRPC, error) {
return nil, err
}

g.name = g.getName()

return g, nil
}

Expand Down Expand Up @@ -142,20 +139,14 @@ func (o *GRPC) CheckAcl(username, topic, clientid string, acc int32) (bool, erro
}

// GetName gets the gRPC backend's name.
func (o *GRPC) getName() string {
func (o *GRPC) GetName() string {
resp, err := o.client.GetName(context.Background(), &empty.Empty{})
if err != nil {
return "gRPC"
return "grpc get name error"
}

return resp.Name
}

// GetName gets the gRPC backend's name.
func (o *GRPC) GetName() string {
return o.name
}

// Halt signals the gRPC backend that mosquitto is halting.
func (o *GRPC) Halt() {
_, err := o.client.Halt(context.Background(), &empty.Empty{})
Expand Down

0 comments on commit c9355ba

Please sign in to comment.