From ba28ba3303dd8a6a6dae2d46cc99930dda040238 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Tue, 16 Jun 2020 23:10:16 +0200 Subject: [PATCH] fix queue name --- app/models/concerns/indexable.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/concerns/indexable.rb b/app/models/concerns/indexable.rb index 077da47c2..7ef5454f7 100644 --- a/app/models/concerns/indexable.rb +++ b/app/models/concerns/indexable.rb @@ -56,7 +56,12 @@ def send_import_message(data) # we use the AWS SQS client directly as there is no consumer in this app def send_message(body, options={}) sqs = Aws::SQS::Client.new - queue_url = sqs.get_queue_url(queue_name: "#{Rails.env}_doi").queue_url + if Rails.env == "stage" + queue_name_prefix = ENV['ES_PREFIX'].present? ? "stage" : "test" + else + queue_name_prefix = Rails.env + end + queue_url = sqs.get_queue_url(queue_name: "#{queue_name_prefix}_doi").queue_url options[:shoryuken_class] ||= "DoiImportWorker" options = {