Sha256: 137f2dcfebd77248a7dc1cb069db21cf4ae630f19b2b937eca1568fe59b89949

Contents?: true

Size: 289 Bytes

Versions: 7

Compression:

Stored size: 289 Bytes

Contents

module Eventboss
  module ErrorHandlers
    class DbConnectionNotEstablishedHandler
      def call(exception, _context = {})
        if exception.class == ::ActiveRecord::ConnectionNotEstablished
          ::ActiveRecord::Base.connection.reconnect!
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
eventboss-1.9.1 lib/eventboss/error_handlers/db_connection_not_established_handler.rb
eventboss-1.9.0 lib/eventboss/error_handlers/db_connection_not_established_handler.rb
eventboss-1.8.1 lib/eventboss/error_handlers/db_connection_not_established_handler.rb
eventboss-1.8.0 lib/eventboss/error_handlers/db_connection_not_established_handler.rb
eventboss-1.7.0 lib/eventboss/error_handlers/db_connection_not_established_handler.rb
eventboss-1.5.0 lib/eventboss/error_handlers/db_connection_not_established_handler.rb
eventboss-1.4.1 lib/eventboss/error_handlers/db_connection_not_established_handler.rb