From 23953dba3f0f2a5c95561f45aaa42f15c3a1f1cb Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Wed, 6 Jan 2021 18:29:08 +0100 Subject: [PATCH] reduze elasticsearch indexing batch size to 50 --- app/models/datacite_doi.rb | 4 ++-- app/models/other_doi.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/datacite_doi.rb b/app/models/datacite_doi.rb index b14a9028b..5496c440e 100644 --- a/app/models/datacite_doi.rb +++ b/app/models/datacite_doi.rb @@ -44,7 +44,7 @@ def self.import_by_ids(options = {}) # TODO remove query for type once STI is enabled # SQS message size limit is 256 kB, up to 2 GB with S3 DataciteDoi.where(type: "DataciteDoi").where(id: from_id..until_id). - find_in_batches(batch_size: 100) do |dois| + find_in_batches(batch_size: 50) do |dois| ids = dois.pluck(:id) DataciteDoiImportInBulkJob.perform_later(ids, index: index) count += ids.length @@ -71,7 +71,7 @@ def self.import_by_client(client_id) # TODO remove query for type once STI is enabled DataciteDoi.where(type: "DataciteDoi").where(datacentre: client.id). - find_in_batches(batch_size: 100) do |dois| + find_in_batches(batch_size: 50) do |dois| ids = dois.pluck(:id) DataciteDoiImportInBulkJob.perform_later(ids, index: self.active_index) end diff --git a/app/models/other_doi.rb b/app/models/other_doi.rb index 1fe547a1c..200c05343 100644 --- a/app/models/other_doi.rb +++ b/app/models/other_doi.rb @@ -95,7 +95,7 @@ def self.import_by_ids(options = {}) # TODO remove query for type once STI is enabled DataciteDoi.where(type: "OtherDoi").where(id: from_id..until_id). - find_in_batches(batch_size: 100) do |dois| + find_in_batches(batch_size: 50) do |dois| ids = dois.pluck(:id) OtherDoiImportInBulkJob.perform_later(ids, index: index) count += ids.length