Skip to content

Commit

Permalink
chore: use correct synatx for rack-timeout for ruby 3
Browse files Browse the repository at this point in the history
    Also update readmde about how to update the rack-timeout
  • Loading branch information
ghassanmas authored and xitij2000 committed Nov 16, 2022
1 parent 0367c31 commit 30220dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
SINATRA_ENV: staging
API_KEY: password
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
RACK_TIMEOUT_SERVICE_TIMEOUT: 20
services:
elasticsearch:
image: elasticsearch:7.8.0
Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ By default Sinatra runs on port `4567`. If you'd like to use a different port pa
$ ruby app.rb -p 5678
Rake timeout configuration should be set as env varaiable, the default value is 15 second. to set to 20 second:

.. code-block::
$ RACK_TIMEOUT_SERVICE_TIMEOUT=20 ruby app.rb -p 5678
Running Tests
-------------
Expand Down
3 changes: 1 addition & 2 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
puts "Loading config.ru."

require "rack-timeout"
use Rack::Timeout # Call as early as possible so rack-timeout runs before other middleware.
Rack::Timeout.timeout = 20
use Rack::Timeout

require "mongoid"
use Mongoid::QueryCache::Middleware
Expand Down

0 comments on commit 30220dc

Please sign in to comment.