Skip to content

Reconnect when the database gets disconnected #56

@searls

Description

@searls

Sometimes when running a test multiple times with the cypress open IDE, the DB connection will die for whatever reason:

2021-01-11 09:10:42 -0500 Rack app ("POST /test_states/database/projects" - (127.0.0.1)): #<ActiveRecord::StatementInvalid: PG::ConnectionBad: connection is closed>

Rather than kill the process and restart, maybe cypress-rails could detect this and attempt to reconnect?

ActiveRecord::Base.connection.reconnect!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions