Skip to content

Commit

Permalink
Heroku updates: shielded-river-1101.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Dec 28, 2013
1 parent 0f2feab commit a91e2d8
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gemfile
@@ -1,8 +1,12 @@
source 'https://rubygems.org'

ruby "2.0.0"

# Specify your gem's dependencies in github-lod.gemspec
gemspec :name => ""

gem 'unicorn'

group :development, :test do
gem 'sparql'
gem 'rake'
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Expand Up @@ -38,6 +38,7 @@ GEM
json (1.8.1)
json-ld (1.1.0)
rdf (>= 1.0.8)
kgio (2.8.1)
linkeddata (1.1.0)
json-ld (>= 1.1.0)
rdf (>= 1.1.0)
Expand Down Expand Up @@ -66,6 +67,7 @@ GEM
rack
rack-test (0.6.2)
rack (>= 1.0)
raindrops (0.12.0)
rake (10.1.1)
rdf (1.1.1.1)
rdf-aggregate-repo (1.1.0)
Expand Down Expand Up @@ -132,6 +134,10 @@ GEM
sxp (0.1.4)
json (>= 1.1.1)
tilt (1.4.1)
unicorn (4.7.0)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
wirble (0.1.3)
yard (0.8.7.3)

Expand All @@ -146,5 +152,6 @@ DEPENDENCIES
rspec (>= 2.14.0)
shotgun (>= 0.9)
sparql
unicorn
wirble
yard (>= 0.8.7)
1 change: 1 addition & 0 deletions Procfile
@@ -0,0 +1 @@
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
22 changes: 22 additions & 0 deletions config/unicorn.rb
@@ -0,0 +1,22 @@
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 15
preload_app true

before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end

defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end

after_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
end

defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
end

0 comments on commit a91e2d8

Please sign in to comment.