Skip to content

Commit

Permalink
Fix when divisor = 0
Browse files Browse the repository at this point in the history
The `if` check for divisor with value 0 was wrong, as it wasn't comparing the value.
  • Loading branch information
cgarciaarano authored and majormoses committed Aug 12, 2017
1 parent 75bff86 commit 26b5d84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/check-es-query-ratio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def run
dividend = client.count(build_request_options)
config[:query] = divisor_query
divisor = client.count(build_request_options)
if divisor == 0
if divisor['count'] == 0
critical 'Divisor is 0, ratio check cannot be performed, raising an alert'
else
response = {}
Expand Down

0 comments on commit 26b5d84

Please sign in to comment.