From ba06d8047d40f885f6c3b0ae5ff08f7ba250aab0 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 21 Dec 2020 21:27:00 +0100 Subject: [PATCH] fix client doi import method. #690 --- app/jobs/doi_not_indexed_job.rb | 4 ++-- app/models/client.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/jobs/doi_not_indexed_job.rb b/app/jobs/doi_not_indexed_job.rb index c9fa75152..3825f5ad6 100644 --- a/app/jobs/doi_not_indexed_job.rb +++ b/app/jobs/doi_not_indexed_job.rb @@ -3,7 +3,7 @@ class DoiNotIndexedJob < ApplicationJob queue_as :lupo_background - def perform(client_id, options = {}) - Doi.import_by_client(client_id, options) + def perform(client_id, _options = {}) + Doi.import_by_ids(model: "Client", client_id: client_id) end end diff --git a/app/models/client.rb b/app/models/client.rb index ef7cf6224..d271ad143 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -719,7 +719,7 @@ def self.import_dois_not_indexed(query: nil) # loop through repositories that have DOIs not indexed in Elasticsearch table.each do |row| Rails.logger.info "Started to import #{row["DOIs in Database"]} DOIs (#{row["DOIs missing"]} missing) for repository #{row["Repository ID"]}." - DoiNotIndexedJob.perform_later(row["Repository ID"], doi_count: row["DOIs in Database"], missing_count: row["DOIs missing"]) + DoiNotIndexedJob.perform_later(model: "Client", client_id: row["Repository ID"]) end end