Skip to content

Commit

Permalink
Make alias swap more explicit and safer
Browse files Browse the repository at this point in the history
  • Loading branch information
billdueber committed Sep 11, 2024
1 parent e5989d3 commit b32a0d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/med_installer/indexing_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def index
a.delete! unless [Dromedary::Services[:production_alias], Dromedary::Services[:preview_alias]].include? a.name
end

create_solr_documents
create_unified_documents

# TODO: SolrCloud::Collection should have a `#url` method, for god's sake
collection_url = @build_collection.connection.url.chomp("/") + "/solr/#{@build_collection.name}"
Expand All @@ -73,6 +73,8 @@ def index
@build_dir.rmtree

logger.info "Point #{Services[:preview_alias]} at the new #{@build_collection.name} collection "
preview_alias = connection.get_alias(Dromedary::Services[:preview_alias])
preview_alias && preview_alias.delete!
@build_collection.alias_as(Services[:preview_alias], force: true)
end

Expand Down Expand Up @@ -103,7 +105,7 @@ def verify_unzipped_files!(build_directory = build_dir)
# This:
# * creates entries.json.gz in the build_directory (build in tmp, then copied)
# * creates the hyp_to_bibid.json file in the build directory, based on the bib_all.xml file
def create_solr_documents(build_directory: build_dir)
def create_unified_documents(build_directory: build_dir)
MedInstaller::Convert.new(command_name: "convert").call(build_directory: build_directory)
end

Expand Down

0 comments on commit b32a0d0

Please sign in to comment.