From 42b3c55062034181284bb8be1e46a19001f8069c Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sat, 4 Apr 2020 13:39:03 +0200 Subject: [PATCH] increase concurrency for brackground jobs --- app/jobs/doi_import_by_id_job.rb | 2 +- app/models/concerns/indexable.rb | 1 - config/shoryuken.yml | 8 ++++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/jobs/doi_import_by_id_job.rb b/app/jobs/doi_import_by_id_job.rb index bd8d4f618..b5db136dc 100644 --- a/app/jobs/doi_import_by_id_job.rb +++ b/app/jobs/doi_import_by_id_job.rb @@ -1,5 +1,5 @@ class DoiImportByIdJob < ActiveJob::Base - queue_as :lupo_background + queue_as :lupo_import rescue_from ActiveJob::DeserializationError, Elasticsearch::Transport::Transport::Errors::BadRequest do |error| Rails.logger.error error.message diff --git a/app/models/concerns/indexable.rb b/app/models/concerns/indexable.rb index 501717958..07f2d8c09 100644 --- a/app/models/concerns/indexable.rb +++ b/app/models/concerns/indexable.rb @@ -8,7 +8,6 @@ module Indexable # use index_document instead of update_document to also update virtual attributes IndexJob.perform_later(self) if self.class.name == "Doi" - update_column(:indexed, Time.zone.now) send_import_message(self.to_jsonapi) if aasm_state == "findable" && !Rails.env.test? && !%w(crossref.citations medra.citations jalc.citations kisti.citations op.citations).include?(client.symbol.downcase) # reindex prefix, not triggered by standard callbacks elsif ["ProviderPrefix", "ClientPrefix"].include?(self.class.name) diff --git a/config/shoryuken.yml b/config/shoryuken.yml index c25703260..9fb98283c 100644 --- a/config/shoryuken.yml +++ b/config/shoryuken.yml @@ -1,12 +1,16 @@ -concurrency: 12 +concurrency: 15 delay: 0 pidfile: tmp/pids/shoryuken.pid queues: - lupo groups: + import: + concurrency: 10 + queues: + - lupo_import transfer: - concurrency: 3 + concurrency: 10 queues: - lupo_transfer background: