“MySQL server has gone away” with Ruby on Rails

后端 未结 11 1311
后悔当初
后悔当初 2020-12-12 19:09

After our Ruby on Rails application has run for a while, it starts throwing 500s with \"MySQL server has gone away\". Often this happens overnight. It\'s started doing this

11条回答
  •  心在旅途
    2020-12-12 19:49

    Try ActiveRecord::Base.connection.verify! in Ruby on Rails 4. Verify pings the server and reconnects if it is not connected.

提交回复
热议问题