Skip to content

Instantly share code, notes, and snippets.

@maxcodes
Created October 9, 2015 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxcodes/17b14ae4b0afbb0a3c0c to your computer and use it in GitHub Desktop.
Save maxcodes/17b14ae4b0afbb0a3c0c to your computer and use it in GitHub Desktop.
workers Integer(ENV['WEB_CONCURRENCY'] || 2) # currently not set, so 2
threads_count = Integer(ENV['MAX_THREADS'] || 5) # currently not set, so 5
threads threads_count, threads_count
preload_app!
rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
on_worker_boot do
# Worker specific setup for Rails 4.1+, See:
# https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
ActiveRecord::Base.establish_connection
if defined?(Resque)
Resque.redis = ENV["<redis-uri>"] || "redis://127.0.0.1:6379"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment