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.8.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.7.0 lib/sentry/rails/background_worker.rb
sentry-rails-5.6.0 lib/sentry/rails/background_worker.rb