2012-05-08 06:01:18 +00:00
|
|
|
# This file is used by Rack-based servers to start the application.
|
2012-06-25 07:57:36 -07:00
|
|
|
if defined? Unicorn
|
2015-09-09 20:45:57 +09:00
|
|
|
require "unicorn/worker_killer"
|
2013-08-05 09:34:18 -07:00
|
|
|
use Unicorn::WorkerKiller::MaxRequests, 4096, 8192
|
2017-04-02 17:06:10 +09:00
|
|
|
use Unicorn::WorkerKiller::Oom, (384*(1024**2)), (512*(1024**2))
|
2012-06-25 07:57:36 -07:00
|
|
|
end
|
2012-03-13 11:34:07 +00:00
|
|
|
|
2021-02-11 16:57:35 +09:00
|
|
|
require_relative "config/environment"
|
2012-12-11 20:56:10 +07:00
|
|
|
# Passenger hates map. And only it, AFAICT.
|
|
|
|
if defined? PhusionPassenger
|
2021-02-11 16:57:35 +09:00
|
|
|
run Rails.application
|
|
|
|
Rails.application.load_server
|
2012-12-11 20:56:10 +07:00
|
|
|
else
|
2015-10-10 17:49:40 +09:00
|
|
|
ENV["RAILS_RELATIVE_URL_ROOT"] ||= "/"
|
|
|
|
|
|
|
|
map ENV["RAILS_RELATIVE_URL_ROOT"] do
|
2021-02-11 16:57:35 +09:00
|
|
|
run Rails.application
|
|
|
|
Rails.application.load_server
|
2012-12-11 20:56:10 +07:00
|
|
|
end
|
2012-07-09 01:13:32 +07:00
|
|
|
end
|