Sha256: b873eaa8feadf383ac063e0755a56d8dddd73e8423cdfd38bbf9a84b97683c74

Contents?: true

Size: 492 Bytes

Versions: 18

Compression:

Stored size: 492 Bytes

Contents

database_setup_proc = lambda do |conn|
  # identify postgres connections coming from this process in pg_stat_activity
  process_identifier = ENV["DYNO"] || File.basename($PROGRAM_NAME).gsub(/\W+/, "_")
  conn.execute "SET statement_timeout = '#{Config.database_timeout}s'"
  conn.execute "SET application_name = '#{process_identifier}'"
end

DB = Sequel.connect(Config.database_url,
                    max_connections: Config.db_pool,
                    after_connect: database_setup_proc)

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
pliny-1.1.0 lib/template/config/initializers/database.rb
pliny-1.0.0 lib/template/config/initializers/database.rb
pliny-0.32.0 lib/template/config/initializers/database.rb
pliny-0.31.0 lib/template/config/initializers/database.rb
pliny-0.30.1 lib/template/config/initializers/database.rb
pliny-0.30.0 lib/template/config/initializers/database.rb
pliny-0.29.0 lib/template/config/initializers/database.rb
pliny-0.28.0 lib/template/config/initializers/database.rb
pliny-0.27.1 lib/template/config/initializers/database.rb
pliny-0.27.0 lib/template/config/initializers/database.rb
pliny-0.26.2 lib/template/config/initializers/database.rb
pliny-0.26.1 lib/template/config/initializers/database.rb
pliny-0.26.0 lib/template/config/initializers/database.rb
pliny-0.25.1 lib/template/config/initializers/database.rb
pliny-0.25.0 lib/template/config/initializers/database.rb
pliny-0.24.0 lib/template/config/initializers/database.rb
pliny-0.23.0 lib/template/config/initializers/database.rb
pliny-0.22.0 lib/template/config/initializers/database.rb