# frozen_string_literal: true

workers Integer(ENV['PUMA_WORKERS'] || 3)
threads Integer(ENV['MIN_THREADS']  || 1), Integer(ENV['MAX_THREADS'] || 16)

preload_app!

rackup      DefaultRackup
port        ENV['PORT']     || 3000
environment ENV['RACK_ENV'] || 'development'

lowlevel_error_handler do |ex, env|
  Raven.capture_exception(
    ex,
    :message => ex.message,
    :extra => { :puma => env },
    :culprit => "Puma"
  )
  [500, {}, ["An error has occurred, and engineers have been informed.\n"]]
end

on_worker_boot do
  DB.disconnect
end

# frozen_string_literal: true

workers Integer(ENV['PUMA_WORKERS'] || 3)
threads Integer(ENV['MIN_THREADS']  || 1), Integer(ENV['MAX_THREADS'] || 16)

preload_app!

rackup      DefaultRackup
port        ENV['PORT']     || 3000
environment ENV['RACK_ENV'] || 'development'

lowlevel_error_handler do |ex, env|
  Raven.capture_exception(
    ex,
    :message => ex.message,
    :extra => { :puma => env },
    :transaction => "Puma"
  )
  [500, {}, ["An error has occurred, and engineers have been informed.\n"]]
end

on_worker_boot do
  DB.disconnect
end

Fix breaking change in Sentry SDK
Fix breaking change in Sentry SDK

This was renamed in sentry-raven 2.7.0: https://github.com/getsentry/raven-ruby/pull/743

We updated from sentry-raven 2.4.0 to 2.9.0 in #132, but we have no test
coverage here, so we didn't spot it.
