File tree 4 files changed +31
-9
lines changed 4 files changed +31
-9
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
ruby '2.0.0'
3
3
4
4
group :heroku do
5
- gem 'thin '
5
+ gem 'unicorn '
6
6
gem 'rails_12factor'
7
7
end
8
8
Original file line number Diff line number Diff line change 36
36
carrierwave (0.6.1 )
37
37
activemodel (>= 3.2.0 )
38
38
activesupport (>= 3.2.0 )
39
- daemons (1.1.9 )
40
39
erubis (2.7.0 )
41
- eventmachine (1.0.0 )
42
40
excon (0.13.4 )
43
41
faraday (0.8.8 )
44
42
multipart-post (~> 1.2.0 )
61
59
json (1.8.0 )
62
60
jwt (0.1.8 )
63
61
multi_json (>= 1.5 )
62
+ kgio (2.8.1 )
64
63
mail (2.5.4 )
65
64
mime-types (~> 1.16 )
66
65
treetop (~> 1.4.8 )
119
118
rake (>= 0.8.7 )
120
119
rdoc (~> 3.4 )
121
120
thor (>= 0.14.6 , < 2.0 )
121
+ raindrops (0.12.0 )
122
122
rake (10.1.0 )
123
123
rdoc (3.12.2 )
124
124
json (~> 1.4 )
@@ -132,16 +132,16 @@ GEM
132
132
sqlite3-ruby (1.3.3 )
133
133
sqlite3 (>= 1.3.3 )
134
134
subexec (0.2.2 )
135
- thin (1.5.0 )
136
- daemons (>= 1.0.9 )
137
- eventmachine (>= 0.12.6 )
138
- rack (>= 1.0.0 )
139
135
thor (0.18.1 )
140
136
tilt (1.4.1 )
141
137
treetop (1.4.15 )
142
138
polyglot
143
139
polyglot (>= 0.3.1 )
144
140
tzinfo (0.3.37 )
141
+ unicorn (4.6.3 )
142
+ kgio (~> 2.6 )
143
+ rack
144
+ raindrops (~> 0.7 )
145
145
146
146
PLATFORMS
147
147
ruby
@@ -159,4 +159,4 @@ DEPENDENCIES
159
159
rails (= 3.2.14 )
160
160
rails_12factor
161
161
sqlite3-ruby
162
- thin
162
+ unicorn
Original file line number Diff line number Diff line change 1
- web : bundle exec thin start -p $PORT -e $RACK_ENV
1
+ web : bundle exec unicorn -p $PORT -c ./config/unicorn.rb
Original file line number Diff line number Diff line change
1
+ worker_processes Integer ( ENV [ "WEB_CONCURRENCY" ] || 3 )
2
+ timeout 15
3
+ preload_app true
4
+
5
+ before_fork do |server , worker |
6
+ Signal . trap 'TERM' do
7
+ puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
8
+ Process . kill 'QUIT' , Process . pid
9
+ end
10
+
11
+ defined? ( ActiveRecord ::Base ) and
12
+ ActiveRecord ::Base . connection . disconnect!
13
+ end
14
+
15
+ after_fork do |server , worker |
16
+ Signal . trap 'TERM' do
17
+ puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
18
+ end
19
+
20
+ defined? ( ActiveRecord ::Base ) and
21
+ ActiveRecord ::Base . establish_connection
22
+ end
You can’t perform that action at this time.
0 commit comments