lib/esse/backend/index/reset.rb in esse-0.0.5 vs lib/esse/backend/index/reset.rb in esse-0.1.1

- old
+ new

@@ -15,17 +15,15 @@ # # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html def reset_index!(suffix: index_version, **options) existing = [] suffix ||= Esse.timestamp - while exist?(suffix: suffix).tap { |exist| existing << suffix if exist } - suffix = Esse.timestamp - end + suffix = Esse.timestamp while exist?(suffix: suffix).tap { |exist| existing << suffix if exist } create_index!(suffix: suffix, **options) import!(suffix: suffix, **options) update_aliases!(suffix: suffix) - existing.each { |s| delete_index!(suffix: suffix, **options) } + existing.each { |_s| delete_index!(suffix: suffix, **options) } true end end include InstanceMethods