How can I set the mysql query timeout in ActiveRecord? I wish to set it to something very short, like 10-15ms. This is for a Sinatra ruby web app.
Thanks.
You could also set it in a per-connection basis like this:
ActiveRecord::Base.connection.instance_variable_get('@connection').instance_variable_set('@read_timeout', 0)
I'm doing this for instance to have a default read_timeout, but override it for my long-running nightly scripts.