-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up an after hook to clear active connections after each request #10
base: master
Are you sure you want to change the base?
Conversation
I'm using this too, found out about it via this thread: https://groups.google.com/forum/#!msg/copenhagen-ruby-user-group/GEHgi_WudmM/gnCiwWqmVfMJ |
You can download the new version of the gem, I've submitted your commit. I'm the new maintainer now, here's my fork :) |
👍 |
Great, thanks janko-m! Glad to meet the new maintainer in town, and it looks like you're already doing great work with your fork. |
My pleasure :) |
Some news about that PR? I'm gettin struck by this problem too... sinatra-activerecord are not releasing a connection, and creating some until the pool cap, getting exceptions on every request after! |
Well, the PR is merged, so if you're still having problems, post an issue to janko-m/sinatra-activerecord. |
why don't use middleware: |
@lksv Thanks, I didn't know that existed. It's certainly a more robust way, so I updated the gem and released a new version. |
Recent versions of ActiveRecord don't automatically release connections back into the pool. Without this patch, the user has to manually set up this hook if they don't want every nth request to hang for 5 seconds (where n is the number of connections in the pool).