Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #914 from dmann/DDS-809-fix_request_timeout-develop
Browse files Browse the repository at this point in the history
DDS-809 fix request timeout develop
  • Loading branch information
dmlond committed Feb 10, 2017
2 parents befe243 + b8553e1 commit db30905
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ gem 'puma'
gem 'rack', '1.6.4' # Remove in rails 5
gem 'rack-cors', :require => 'rack/cors'
gem 'grape-middleware-lograge'
gem "rack-timeout"

gem 'grape-swagger'
gem 'kaminari'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ GEM
rack
rack-test (0.6.3)
rack (>= 1.0)
rack-timeout (0.4.2)
rails (4.2.1)
actionmailer (= 4.2.1)
actionpack (= 4.2.1)
Expand Down Expand Up @@ -342,6 +343,7 @@ DEPENDENCIES
pundit
rack (= 1.6.4)
rack-cors
rack-timeout
rails (= 4.2.1)
rails_12factor
rspec-rails
Expand Down
4 changes: 4 additions & 0 deletions config/initializers/rack_timeout.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Rack::Timeout.service_timeout = Integer(ENV['RACK_TIMEOUT_SERVICE_TIMEOUT']) if ENV.has_key?('RACK_TIMEOUT_SERVICE_TIMEOUT')
Rack::Timeout.wait_timeout = Integer(ENV['RACK_TIMEOUT_WAIT_TIMEOUT']) if ENV.has_key?('RACK_TIMEOUT_WAIT_TIMEOUT')
Rack::Timeout.wait_overtime = Integer(ENV['RACK_TIMEOUT_WAIT_OVERTIME']) if ENV.has_key?('RACK_TIMEOUT_WAIT_OVERTIME')
Rack::Timeout.service_past_wait = (ENV['RACK_TIMEOUT_SERVICE_PAST_WAIT'] == 'true')
1 change: 0 additions & 1 deletion config/puma.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['MAX_THREADS'] || 5)
threads threads_count, threads_count
worker_timeout Integer(ENV['WORKER_TIMEOUT']) if ENV['WORKER_TIMEOUT']

preload_app!

Expand Down

0 comments on commit db30905

Please sign in to comment.