Sha256: 1f17fc0947539031d8a6f5e4f410c526ce26ca582658ce2ef445e8cfa62a2de3

Contents?: true

Size: 401 Bytes

Versions: 23

Compression:

Stored size: 401 Bytes

Contents

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

23 entries across 23 versions & 1 rubygems

Version Path
sentry-rails-5.20.1 lib/sentry/rails/background_worker.rb
sentry-rails-5.20.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.19.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.18.2 lib/sentry/rails/background_worker.rb
sentry-rails-5.18.1 lib/sentry/rails/background_worker.rb
sentry-rails-5.18.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.17.3 lib/sentry/rails/background_worker.rb
sentry-rails-5.17.2 lib/sentry/rails/background_worker.rb
sentry-rails-5.17.1 lib/sentry/rails/background_worker.rb
sentry-rails-5.17.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.16.1 lib/sentry/rails/background_worker.rb
sentry-rails-5.15.2 lib/sentry/rails/background_worker.rb
sentry-rails-5.15.1 lib/sentry/rails/background_worker.rb
sentry-rails-5.15.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.14.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.13.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.12.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.11.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.10.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.9.0 lib/sentry/rails/background_worker.rb