Skip to content

Commit

Permalink
Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed Nov 15, 2024
1 parent 0f9ce78 commit 66a5e4a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/aws/rails/middleware/elastic_beanstalk_sqsd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def execute_job(request)

begin
::ActiveJob::Base.execute(job)
rescue NoMethodError, NameError => e
rescue NameError => e
@logger.error("Job #{job_name} could not resolve to a class that inherits from Active Job.")
@logger.error("Error: #{e}")
return internal_error_response
Expand All @@ -55,7 +55,7 @@ def execute_periodic_task(request)
begin
job = job_name.constantize.new
job.perform_now
rescue NoMethodError, NameError => e
rescue NameError => e
@logger.error("Periodic task #{job_name} could not resolve to an Active Job class - check the spelling in cron.yaml.")
@logger.error("Error: #{e}.")
return internal_error_response
Expand Down Expand Up @@ -118,11 +118,10 @@ def build_default_docker_ips
File.open('/proc/net/route').each_line do |line|
fields = line.strip.split
next if fields.size != 11

# Destination == 0.0.0.0 and Flags & RTF_GATEWAY != 0
if fields[1] == '00000000' && fields[3].hex.anybits?(0x2)
default_gw_ips << IPAddr.new_ntoh([fields[2].hex].pack('L')).to_s
end
next unless fields[1] == '00000000' && fields[3].hex.anybits?(0x2)

default_gw_ips << IPAddr.new_ntoh([fields[2].hex].pack('L')).to_s
end
end

Expand Down

0 comments on commit 66a5e4a

Please sign in to comment.