Skip to content

Commit

Permalink
Merge pull request #944 from datacite/client_update_reindex_3
Browse files Browse the repository at this point in the history
Changes to improve performance and integrity of import_by_client
  • Loading branch information
codycooperross authored Mar 30, 2023
2 parents c0794af + 65e9ad8 commit e7aa3a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/models/datacite_doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ def self.import_by_client(client_id)
end

# import DOIs for client
Rails.logger.info "Started import of #{client.dois.length} DOIs for repository #{client_id}."
Rails.logger.info "Started import of #{client.dois.count} DOIs for repository #{client_id}."

# TODO remove query for type once STI is enabled
DataciteDoi.where(type: "DataciteDoi").where(datacentre: client.id).
DataciteDoi.where(datacentre: client.id).
find_in_batches(batch_size: 50) do |dois|
ids = dois.pluck(:id)
DataciteDoiImportInBulkJob.perform_later(ids, index: self.active_index)
Expand Down

0 comments on commit e7aa3a9

Please sign in to comment.