Sha256: b2456b6a80399b9a46fa7e29999690f0798270d4d642d1f22b8a43483014b7d9

Contents?: true

Size: 649 Bytes

Versions: 3

Compression:

Stored size: 649 Bytes

Contents

require "sucker_punch"

module Blazer
  class RunStatementJob
    include SuckerPunch::Job
    workers 4

    def perform(result, data_source, statement, options)
      begin
        ActiveRecord::Base.connection_pool.with_connection do
          result << RunStatement.new.perform(data_source, statement, options)
        end
      rescue Exception => e
        result.clear
        result << Blazer::Result.new(data_source, [], [], "Unknown error", nil, false)
        Blazer.cache.write(data_source.run_cache_key(options[:run_id]), Marshal.dump([[], [], "Unknown error", nil]), expires_in: 30.seconds)
        raise e
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blazer-1.6.2 lib/blazer/run_statement_job.rb
blazer-1.6.1 lib/blazer/run_statement_job.rb
blazer-1.6.0 lib/blazer/run_statement_job.rb