Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 15, 2020
1 parent 50b210e commit 93c3e96
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def delete_index
# Needs to run every time we change the mappings
def upgrade_index
inactive_index ||= self.inactive_index

self.__elasticsearch__.delete_index!(index: inactive_index) if self.__elasticsearch__.index_exists?(index: inactive_index)

if self.__elasticsearch__.index_exists?(index: inactive_index)
Expand All @@ -501,10 +501,9 @@ def index_stats(options={})
inactive_index_count = stats.dig("indices", inactive_index, "primaries", "docs", "count")
database_count = self.all.count

message = "Active index #{active_index} has #{active_index_count} documents, " \
"Active index #{active_index} has #{active_index_count} documents, " \
"inactive index #{inactive_index} has #{inactive_index_count} documents, " \
"database has #{database_count} documents."
return message
end

# switch between the two indexes, i.e. the index that is aliased
Expand All @@ -531,7 +530,7 @@ def switch_index(options={})
{ add: { index: index_name, alias: alias_name } }
]
}

"Switched active index to #{index_name}."
end
end
Expand Down

0 comments on commit 93c3e96

Please sign in to comment.