Rebuild search indices in post deploy
This commit is contained in:
parent
901a7398fa
commit
d16680c8ec
1 changed files with 19 additions and 0 deletions
|
|
@ -19,6 +19,8 @@ class PostDeploymentManager
|
||||||
import_new_data
|
import_new_data
|
||||||
display_import_summary
|
display_import_summary
|
||||||
download_images
|
download_images
|
||||||
|
rebuild_search_indices
|
||||||
|
display_completion_message
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
@ -44,6 +46,15 @@ class PostDeploymentManager
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def rebuild_search_indices
|
||||||
|
log_step "\nRebuilding search indices..."
|
||||||
|
|
||||||
|
[Character, Summon, Weapon, Job].each do |model|
|
||||||
|
log_verbose "Rebuilding search index for #{model.name}..."
|
||||||
|
PgSearch::Multisearch.rebuild(model)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def display_import_summary
|
def display_import_summary
|
||||||
log_step "\nImport Summary:"
|
log_step "\nImport Summary:"
|
||||||
display_record_summary("New", @new_records)
|
display_record_summary("New", @new_records)
|
||||||
|
|
@ -104,6 +115,14 @@ class PostDeploymentManager
|
||||||
puts e.backtrace.take(5) if @verbose
|
puts e.backtrace.take(5) if @verbose
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def display_completion_message
|
||||||
|
if @test_mode
|
||||||
|
log_step "\n✓ Test run completed successfully!"
|
||||||
|
else
|
||||||
|
log_step "\n✓ Post-deployment tasks completed successfully!"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def all_records_empty?
|
def all_records_empty?
|
||||||
@new_records.values.all?(&:empty?) && @updated_records.values.all?(&:empty?)
|
@new_records.values.all?(&:empty?) && @updated_records.values.all?(&:empty?)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue