Sha256: 510d9bb29b0c3b3028d3f567edc34fc6ff4f45d0bfffd3984b99627cc12c850b

Contents?: true

Size: 402 Bytes

Versions: 110

Compression:

Stored size: 402 Bytes

Contents

Rails.application.config.after_initialize do
  ActiveRecord::Base.connection_pool.disconnect!

  ActiveSupport.on_load(:active_record) do
    config = Rails.application.config.database_configuration[Rails.env]
    config['reaping_frequency'] = ENV['DB_REAP_FREQ'] || 10 # seconds
    config['pool']              = ENV['DB_POOL']      || 16
    ActiveRecord::Base.establish_connection(config)
  end
end

Version data entries

110 entries across 110 versions & 1 rubygems

Version Path
lalala-4.0.0.dev.217 config/initializers/database.rb
lalala-4.0.0.dev.216 config/initializers/database.rb
lalala-4.0.0.dev.215 config/initializers/database.rb
lalala-4.0.0.dev.212 config/initializers/database.rb
lalala-4.0.0.dev.208 config/initializers/database.rb
lalala-4.0.0.dev.202 config/initializers/database.rb
lalala-4.0.0.dev.201 config/initializers/database.rb
lalala-4.0.0.dev.198 config/initializers/database.rb
lalala-4.0.0.dev.195 config/initializers/database.rb
lalala-4.0.0.dev.194 config/initializers/database.rb