Skip to content

Commit

Permalink
Upgrade Unicorn
Browse files Browse the repository at this point in the history
In this change I'm upgrading unicorn in order to get the call back
`after_worker_exit`. I need this in development to kill ghost workers
that are pilling up on my computer every time I restart the app.
  • Loading branch information
gabrielpoca committed Mar 2, 2018
1 parent fee8ae1 commit 8d887d2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ source "https://rubygems.org"

group :production do
gem "pg", "~> 0.18.4"
gem "unicorn", "~> 4.7"
end

group :development do
Expand Down Expand Up @@ -46,4 +45,5 @@ gem "sprockets", "~> 3.0"
gem "sprockets-helpers"
gem "thread", "~> 0.2"
gem "uglifier"
gem "unicorn", "~> 5.4.0"
gem "will_paginate", "~> 3.1"
9 changes: 4 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ GEM
sax-machine (>= 1.0)
i18n (0.7.0)
json (1.8.3)
kgio (2.10.0)
kgio (2.11.2)
loofah (2.1.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
Expand Down Expand Up @@ -100,7 +100,7 @@ GEM
rack (>= 1.0)
rack-test (>= 0.5)
rainbow (2.1.0)
raindrops (0.16.0)
raindrops (0.19.0)
rake (10.5.0)
rspec (3.4.0)
rspec-core (~> 3.4.0)
Expand Down Expand Up @@ -170,9 +170,8 @@ GEM
uglifier (3.0.2)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.0.2)
unicorn (4.9.0)
unicorn (5.4.0)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
will_paginate (3.1.0)
xpath (2.0.0)
Expand Down Expand Up @@ -216,7 +215,7 @@ DEPENDENCIES
thread (~> 0.2)
timecop (~> 0.8)
uglifier
unicorn (~> 4.7)
unicorn (~> 5.4.0)
will_paginate (~> 3.1)

RUBY VERSION
Expand Down
4 changes: 4 additions & 0 deletions config/unicorn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@
ActiveRecord::Base.establish_connection(config)
end
end

after_worker_exit do |_server, _worker, _status|
Process.kill("QUIT", @delayed_job_pid) if !ENV["RACK_ENV"] || ENV["RACK_ENV"] == "development"
end

0 comments on commit 8d887d2

Please sign in to comment.