ActiveRecordServerless
Handles database connection's to disconnect on a timeout. This allows Aurora Serverless servers to spin down.
Installing
In a Gemfile
gem 'active_record_serverless'
Manually
gem install active_record_serverless
Config
# in config/database.yml
development:
# other db params
serverless:
timeout: 60.0 # Timeout every 60 seconds.
Forking
after_fork do
ActiveRecordServerless.start_timeout
end
Non-Rails Application.
Setup
ActiveRecordServerless::Installer.install!(nil)