diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/webrick_server.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 444a918a7c..62e7fdcaae 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,6 +1,6 @@ *SVN* -* Removed the mutex from the WEBrick adapter under the production environment so concurrent requests can be served +* Made the WEBrick adapter not use a mutex around action performance if ActionController::Base.allow_concurrency is true (default is false) * Fixed that mailer generator generated fixtures/plural while units expected fixtures/singular #1457 [Scott Barron] diff --git a/railties/lib/webrick_server.rb b/railties/lib/webrick_server.rb index 137c2570ca..71df5432e1 100644 --- a/railties/lib/webrick_server.rb +++ b/railties/lib/webrick_server.rb @@ -65,13 +65,13 @@ class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet def service(req, res) begin unless handle_file(req, res) - REQUEST_MUTEX.lock unless RAILS_ENV == 'production' + REQUEST_MUTEX.lock unless ActionController::Base.allow_concurrency unless handle_dispatch(req, res) raise WEBrick::HTTPStatus::NotFound, "`#{req.path}' not found." end end ensure - unless RAILS_ENV == 'production' + unless ActionController::Base.allow_concurrency REQUEST_MUTEX.unlock if REQUEST_MUTEX.locked? end end |