$tmp_dir is not set on heroku
This commit is contained in:
parent
815d9e6e9b
commit
16c871d740
|
@ -2,7 +2,8 @@ root = File.expand_path('../..', __FILE__)
|
||||||
|
|
||||||
rackup "#{root}/config.ru"
|
rackup "#{root}/config.ru"
|
||||||
|
|
||||||
bind "unix://#{ENV["tmp_dir"]}/nginx.socket"
|
tmp_dir = ENV.fetch("tmp_dir", "/tmp")
|
||||||
|
bind "unix://#{tmp_dir}/nginx.socket"
|
||||||
environment ENV['RACK_ENV'] || 'development'
|
environment ENV['RACK_ENV'] || 'development'
|
||||||
|
|
||||||
threads 0, 16
|
threads 0, 16
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
worker_processes Integer(ENV.fetch('WEB_CONCURRENCY')) # amount of unicorn workers to spin up
|
worker_processes Integer(ENV.fetch('WEB_CONCURRENCY')) # amount of unicorn workers to spin up
|
||||||
timeout 30 # restarts workers that hang for 30 seconds
|
timeout 30 # restarts workers that hang for 30 seconds
|
||||||
|
|
||||||
listen File.expand_path("nginx.socket", ENV["tmp_dir"]), backlog: 1024
|
tmp_dir = ENV.fetch("tmp_dir", "/tmp")
|
||||||
|
listen File.expand_path("nginx.socket", tmp_dir), backlog: 1024
|
||||||
|
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
before_fork do |server, worker|
|
before_fork do |server, worker|
|
||||||
|
@ -11,5 +12,5 @@ before_fork do |server, worker|
|
||||||
require 'travis/api/app'
|
require 'travis/api/app'
|
||||||
|
|
||||||
# signal to nginx we're ready
|
# signal to nginx we're ready
|
||||||
FileUtils.touch("#{ENV["tmp_dir"]}/app-initialized")
|
FileUtils.touch("#{tmp_dir}/app-initialized")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user