From 4191d978cf745013fcd0cb0f69abe5be878ee7e5 Mon Sep 17 00:00:00 2001 From: Karan Nanda Date: Sat, 18 Apr 2020 01:03:47 +0530 Subject: [PATCH] adding debuggers --- .../queue_adapters/active_elastic_job_adapter.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/active_job/queue_adapters/active_elastic_job_adapter.rb b/lib/active_job/queue_adapters/active_elastic_job_adapter.rb index 9411fdf..c8ddaee 100644 --- a/lib/active_job/queue_adapters/active_elastic_job_adapter.rb +++ b/lib/active_job/queue_adapters/active_elastic_job_adapter.rb @@ -117,6 +117,7 @@ def enqueue_at(job, timestamp) #:nodoc: @queue_urls[job.queue_name.to_s] = nil retry end + Rails.logger.debug "****DEBUG: called from enqueue_at with @queue_urls #{@queue_urls.inspect}" raise NonExistentQueue.new(job, aws_region) rescue Aws::Errors::ServiceError => e raise Error, "Could not enqueue job, #{e.message}" @@ -150,9 +151,11 @@ def queue_url(queue_name) cache_key = queue_name.to_s @queue_urls ||= { } return @queue_urls[cache_key] if @queue_urls[cache_key] + Rails.logger.debug "******DEBUG: aws_sqs_client #{aws_sqs_client.inspect}" resp = aws_sqs_client.get_queue_url(queue_name: queue_name.to_s) @queue_urls[cache_key] = resp.queue_url rescue Aws::SQS::Errors::NonExistentQueue => e + Rails.logger.debug "******DEBUG: called from queue_url with @queue_urls #{@queue_urls.inspect}" raise NonExistentQueue.new(queue_name, aws_region) end @@ -181,6 +184,11 @@ def aws_sqs_client_credentials else config.aws_credentials end + if @aws_credentials.present? + Rails.logger.debug "******DEBUG: aws_credentials #{@aws_credentials.inspect}" + else + Rails.logger.debug "******DEBUG: aws_credentials not present}" + end end def aws_region