I\'m using heroku and heroku postgresql. How do I set db command timeout so that I get an exception when a sql command takes longer than 10 seconds?
Adding
ActiveRecord::Base.connection.execute('set statement_timeout to 10000')
to the end of the environment.rb file did not work for me.
environment.rb
What worked was adding
ActiveRecord::Base.connection.execute("SET statement_timeout = '10s'")
to an initialize file.