diff --git a/lib/elasticsearch/drain/node.rb b/lib/elasticsearch/drain/node.rb index dc453ed..f6a6533 100644 --- a/lib/elasticsearch/drain/node.rb +++ b/lib/elasticsearch/drain/node.rb @@ -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