Skip to content

Commit

Permalink
adding debuggers
Browse files Browse the repository at this point in the history
  • Loading branch information
KaranN committed Apr 17, 2020
1 parent ec51c5d commit 4191d97
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/active_job/queue_adapters/active_elastic_job_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4191d97

Please sign in to comment.