Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #47 from rapid7/PD-28725-fix-in-recovery-method
Browse files Browse the repository at this point in the history
prevents drain from failing when object is empty
  • Loading branch information
eheaney-r7 authored Mar 10, 2021
2 parents 8e117ff + 4d7521d commit 29ca002
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/elasticsearch/drain/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def address(str)
end

def in_recovery?
recovery = client.cat.recovery(format: 'json', v: true).first.values
recovery = client.cat.recovery(format: 'json', v: true)
if recovery.first != nil
recovery = recovery.first.values
end
[hostname, name].any? { |a| recovery.include?(a) }
end

Expand Down

0 comments on commit 29ca002

Please sign in to comment.