Skip to content

Instantly share code, notes, and snippets.

@Jell
Last active December 16, 2015 08:19
Show Gist options
  • Save Jell/5404733 to your computer and use it in GitHub Desktop.
Save Jell/5404733 to your computer and use it in GitHub Desktop.
at_exit do
ActiveRecord::Base.clear_all_connections!
java.lang.Thread.all_stack_traces.key_set.each do |t|
t.synchronized do
if t.name.include?("Abandoned connection cleanup thread")
t.class.shutdown
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment