run_statement_job.rb 413 B

12345678910111213141516
  1. require "sucker_punch"
  2. module Blazer
  3. class RunStatementJob
  4. include SuckerPunch::Job
  5. workers 4
  6. def perform(result, data_source, statement, options)
  7. ActiveRecord::Base.connection_pool.with_connection do
  8. data_source.connection_model.connection_pool.with_connection do
  9. result << RunStatement.new.perform(data_source, statement, options)
  10. end
  11. end
  12. end
  13. end
  14. end