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

prevents drain from failing when object is empty #47

Merged
merged 1 commit into from
Mar 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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