Skip to content

Commit

Permalink
Increase default Puma timeout, and make it configurable via YAML.
Browse files Browse the repository at this point in the history
This allows for configuring if Elasticsearch is slower to respond than
15 seconds, since those API requests can sometimes take longer.
  • Loading branch information
GUI committed May 26, 2017
1 parent 25691cb commit bfe3f06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ web:
host: 127.0.0.1
port: 14012
rails_secret_token:
request_timeout: 30
puma:
workers: 2
min_threads: 2
Expand Down
6 changes: 1 addition & 5 deletions src/api-umbrella/web-app/config/initializers/timeout.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
if(Rails.env.development?)
Rack::Timeout.timeout = 60 # seconds
else
Rack::Timeout.timeout = 15 # seconds
end
Rack::Timeout.timeout = ApiUmbrellaConfig[:web][:request_timeout] # seconds

Rack::Timeout::Logger.device = $stderr
Rack::Timeout::Logger.level = Logger::ERROR

0 comments on commit bfe3f06

Please sign in to comment.