Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
omerlavanet committed Apr 10, 2023
1 parent f729c19 commit f434c49
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions protocol/lavasession/consumer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (cswp *ConsumerSessionsWithProvider) fetchEndpointConnectionFromConsumerSes
if !endpoint.Enabled {
continue
}
connectEndpoint := func(cswp *ConsumerSessionsWithProvider, ctx context.Context, endpoint *Endpoint) (connected bool) {
connectEndpoint := func(cswp *ConsumerSessionsWithProvider, ctx context.Context, endpoint *Endpoint) (connected_ bool) {
if endpoint.Client != nil && endpoint.connection.GetState() != connectivity.Shutdown {
return true
}
Expand All @@ -287,20 +287,19 @@ func (cswp *ConsumerSessionsWithProvider) fetchEndpointConnectionFromConsumerSes
return true
}
if endpoint.Client == nil {
connected := connectEndpoint(cswp, ctx, endpoint)
if !connected {
connected_ := connectEndpoint(cswp, ctx, endpoint)
if !connected_ {
continue
}
} else {
if endpoint.connection.GetState() == connectivity.Shutdown {
// connection was shut down, so we need to create a new one
endpoint.connection.Close()
endpoint.Client = nil
connected := connectEndpoint(cswp, ctx, endpoint)
if !connected {
continue
}
} else if endpoint.connection.GetState() == connectivity.Shutdown {
// connection was shut down, so we need to create a new one
endpoint.connection.Close()
endpoint.Client = nil
connected_ := connectEndpoint(cswp, ctx, endpoint)
if !connected_ {
continue
}

}
cswp.Endpoints[idx] = endpoint
return true, endpoint, false
Expand Down

0 comments on commit f434c49

Please sign in to comment.