execute_job

in lib/aws/rails/middleware/ebs_sqs_active_job_middleware.rb [36:52]


      def execute_job(request)
        
        job = Aws::Json.load(request.body.string)
        job_name = job['job_class']
        @logger.debug("Executing job: #{job_name}")

        begin
          ActiveJob::Base.execute(job)
        rescue NoMethodError, 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
        end

        [200, { 'Content-Type' => 'text/plain' }, ["Successfully ran job #{job_name}."]]
      end