Skip to content

Commit

Permalink
Skip index deletion if there are no old indices
Browse files Browse the repository at this point in the history
  • Loading branch information
allizad committed Jul 17, 2016
1 parent 9af6f13 commit b33546e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/searchyll/indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,16 @@ def finalize!

# delete old indices
cleanup_indices = http_delete("/#{old_indices.join(',')}")
print %(Old indices: #{old_indices})

# run the prepared requests
http_start do |http|
http.request(refresh)
http.request(add_replication)
http.request(update_aliases)
http.request(cleanup_indices)
if !old_indices.empty?
http.request(cleanup_indices)
end
end
end

Expand Down

0 comments on commit b33546e

Please sign in to comment.