Skip to content

Commit

Permalink
Datadog: isActive should react on num > 0 (#2798)
Browse files Browse the repository at this point in the history
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
  • Loading branch information
zroubalik authored Mar 23, 2022
1 parent 52a7416 commit f8f86bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/scalers/datadog_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ func (s *datadogScaler) Close(context.Context) error {
return nil
}

// IsActive checks whether the value returned by Datadog is higher than the target value
// IsActive checks whether the scaler is active
func (s *datadogScaler) IsActive(ctx context.Context) (bool, error) {
num, err := s.getQueryResult(ctx)

if err != nil {
return false, err
}

return num > float64(s.metadata.queryValue), nil
return num > 0, nil
}

// getQueryResult returns result of the scaler query
Expand Down

0 comments on commit f8f86bd

Please sign in to comment.