Sha256: 1736275336f9efee9def4bae44072cb3cd55916863535374bbb0114a16a6e84e

Contents?: true

Size: 432 Bytes

Versions: 4

Compression:

Stored size: 432 Bytes

Contents

# frozen_string_literal: true

module Sentry
  class BackgroundWorker
    def _perform(&block)
      block.call
    ensure
      # some applications have partial or even no AR connection
      if ActiveRecord::Base.connected?
        # make sure the background worker returns AR connection if it accidentally acquire one during serialization
        ActiveRecord::Base.connection_pool.release_connection
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sentry-rails-5.22.2 lib/sentry/rails/background_worker.rb
sentry-rails-5.22.1 lib/sentry/rails/background_worker.rb
sentry-rails-5.22.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.21.0 lib/sentry/rails/background_worker.rb