Skip to content

Commit

Permalink
chore: remove unnecessary variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mknet3 committed Nov 7, 2022
1 parent 5930663 commit d0ab10b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions pkg/scalers/nats_jetstream_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ func getNATSJetStreamEndpoint(useHTTPS bool, natsServerEndpoint string, account
}

func (s *natsJetStreamScaler) IsActive(ctx context.Context) (bool, error) {
monitoringEndpoint := s.metadata.monitoringEndpoint

req, err := http.NewRequestWithContext(ctx, http.MethodGet, monitoringEndpoint, nil)
req, err := http.NewRequestWithContext(ctx, http.MethodGet, s.metadata.monitoringEndpoint, nil)
if err != nil {
return false, err
}
Expand Down
6 changes: 2 additions & 4 deletions pkg/scalers/stan_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ func parseStanMetadata(config *ScalerConfig) (stanMetadata, error) {

// IsActive determines if we need to scale from zero
func (s *stanScaler) IsActive(ctx context.Context) (bool, error) {
monitoringEndpoint := s.metadata.monitoringEndpoint

req, err := http.NewRequestWithContext(ctx, "GET", monitoringEndpoint, nil)
req, err := http.NewRequestWithContext(ctx, "GET", s.metadata.monitoringEndpoint, nil)
if err != nil {
return false, err
}
Expand All @@ -165,7 +163,7 @@ func (s *stanScaler) IsActive(ctx context.Context) (bool, error) {
}
defer baseResp.Body.Close()
if baseResp.StatusCode == 404 {
s.logger.Info("Streaming broker endpoint returned 404. Please ensure it has been created", "url", monitoringEndpoint, "channelName", s.metadata.subject)
s.logger.Info("Streaming broker endpoint returned 404. Please ensure it has been created", "url", s.metadata.monitoringEndpoint, "channelName", s.metadata.subject)
} else {
s.logger.Info("Unable to connect to STAN. Please ensure you have configured the ScaledObject with the correct endpoint.", "baseResp.StatusCode", baseResp.StatusCode, "monitoringEndpoint", s.metadata.monitoringEndpoint)
}
Expand Down

0 comments on commit d0ab10b

Please sign in to comment.