Skip to content

Commit 45dbe45

Browse files
committed
Replace webrick by puma
1 parent a868fa7 commit 45dbe45

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

CHANGELOG.rdoc

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ KalibroProcessor is the processing web service for Mezuro.
44

55
== Unreleased
66

7+
- Replace webrick by puma
8+
79
== v.1.3.3 - 29/07/2016
810

911
* Insert in one query all aggregated MetricResults

Gemfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ group :cucumber do
109109
# gem 'database_cleaner' # Removed because it is getting added above.
110110
end
111111

112-
112+
# Use puma as the app server
113+
gem 'puma'
113114

114115
# Use ActiveModel has_secure_password
115116
# gem 'bcrypt-ruby', '~> 3.0.0'

Gemfile.lock

+3-1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ GEM
266266
method_source (~> 0.8.1)
267267
slop (~> 3.4)
268268
psych (2.0.15)
269+
puma (3.6.0)
269270
rack (1.6.4)
270271
rack-test (0.6.3)
271272
rack (>= 1.0)
@@ -415,6 +416,7 @@ DEPENDENCIES
415416
mocha
416417
pg
417418
psych (~> 2.0.12)
419+
puma
418420
rails (= 4.2.4)
419421
rails-html-sanitizer (~> 1.0)
420422
rspec-rails (~> 3.3.2)
@@ -427,4 +429,4 @@ DEPENDENCIES
427429
unparser (< 0.2.5)
428430

429431
BUNDLED WITH
430-
1.12.5
432+
1.13.3

Procfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
web: bundle exec rails s -p $PORT -e $RAILS_ENV
1+
web: bundle exec puma -C config/puma.rb
22
jobs: bundle exec rake jobs:work

config/puma.rb

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
2+
threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5)
3+
threads threads_count, threads_count
4+
5+
preload_app!
6+
7+
rackup DefaultRackup
8+
port ENV['PORT'] || 8082
9+
environment ENV['RACK_ENV'] || 'development'
10+
11+
on_worker_boot do
12+
# Worker specific setup for Rails 4.1
13+
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
14+
ActiveRecord::Base.establish_connection
15+
end

0 commit comments

Comments
 (0)