Sha256: 27f7f364014e4d17fd204da7fa18204e653c35d29900ad217786731fc03590dd

Contents?: true

Size: 657 Bytes

Versions: 21

Compression:

Stored size: 657 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 << Blazer::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

21 entries across 21 versions & 3 rubygems

Version Path
railsblazer-2.0.0 lib/blazer/run_statement_job.rb
sql-jarvis-2.0.1 lib/blazer/run_statement_job.rb
sql-jarvis-1.9.9 lib/blazer/run_statement_job.rb
sql-jarvis-1.9.8 lib/blazer/run_statement_job.rb
sql-jarvis-1.9.7 lib/blazer/run_statement_job.rb
sql-jarvis-1.9.6 lib/blazer/run_statement_job.rb
blazer-1.9.0 lib/blazer/run_statement_job.rb
blazer-1.8.2 lib/blazer/run_statement_job.rb
sql-jarvis-1.8.0 lib/blazer/run_statement_job.rb
blazer-1.8.0 lib/blazer/run_statement_job.rb
blazer-1.7.10 lib/blazer/run_statement_job.rb
blazer-1.7.9 lib/blazer/run_statement_job.rb
blazer-1.7.8 lib/blazer/run_statement_job.rb
blazer-1.7.7 lib/blazer/run_statement_job.rb
blazer-1.7.6 lib/blazer/run_statement_job.rb
blazer-1.7.5 lib/blazer/run_statement_job.rb
blazer-1.7.4 lib/blazer/run_statement_job.rb
blazer-1.7.3 lib/blazer/run_statement_job.rb
blazer-1.7.2 lib/blazer/run_statement_job.rb
blazer-1.7.1 lib/blazer/run_statement_job.rb