Sha256: d283ced828ad2f4e561060fd1aa330ed03fcc4b6c7ae9a4b80ef835ed3a21a77

Contents?: true

Size: 360 Bytes

Versions: 46

Compression:

Stored size: 360 Bytes

Contents

module Shipit
  class BackgroundJob < ActiveJob::Base
    class << self
      attr_accessor :timeout
    end

    def perform(*)
      with_timeout do
        super
      end
    end

    private

    def with_timeout(&block)
      return yield unless timeout
      Timeout.timeout(timeout, &block)
    end

    def logger
      Rails.logger
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 app/jobs/shipit/background_job.rb
shipit-engine-0.30.0 app/jobs/shipit/background_job.rb
shipit-engine-0.29.0 app/jobs/shipit/background_job.rb
shipit-engine-0.28.1 app/jobs/shipit/background_job.rb
shipit-engine-0.28.0 app/jobs/shipit/background_job.rb
shipit-engine-0.27.1 app/jobs/shipit/background_job.rb
shipit-engine-0.27.0 app/jobs/shipit/background_job.rb
shipit-engine-0.26.0 app/jobs/shipit/background_job.rb
shipit-engine-0.25.1 app/jobs/shipit/background_job.rb
shipit-engine-0.25.0 app/jobs/shipit/background_job.rb
shipit-engine-0.24.0 app/jobs/shipit/background_job.rb
shipit-engine-0.23.1 app/jobs/shipit/background_job.rb
shipit-engine-0.23.0 app/jobs/shipit/background_job.rb
shipit-engine-0.22.0 app/jobs/shipit/background_job.rb
shipit-engine-0.21.0 app/jobs/shipit/background_job.rb
shipit-engine-0.20.1 app/jobs/shipit/background_job.rb
shipit-engine-0.20.0 app/jobs/shipit/background_job.rb
shipit-engine-0.19.0 app/jobs/shipit/background_job.rb
shipit-engine-0.18.1 app/jobs/shipit/background_job.rb
shipit-engine-0.18.0 app/jobs/shipit/background_job.rb