Skip to content

Commit

Permalink
reassign err to prevent invalid return in KedaProvider GetExternalMetric
Browse files Browse the repository at this point in the history
Signed-off-by: Max Cao <macao@redhat.com>
  • Loading branch information
maxcao13 committed Jul 31, 2024
1 parent 352665f commit c4c850c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ func (p *KedaProvider) GetExternalMetric(ctx context.Context, namespace string,
// Get Metrics from Metrics Service gRPC Server
if !p.grpcClient.WaitForConnectionReady(ctx, logger) {
grpcClientConnected = false
logger.Error(fmt.Errorf("timeout while waiting to establish gRPC connection to KEDA Metrics Service server"), "timeout", "server", p.grpcClient.GetServerURL())
err := fmt.Errorf("timeout while waiting to establish gRPC connection to KEDA Metrics Service server")
logger.Error(err, "timeout", "server", p.grpcClient.GetServerURL())
return nil, err
}
if !grpcClientConnected {
Expand Down

0 comments on commit c4c850c

Please sign in to comment.