aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/default_middleware_stack.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2014-09-30 01:46:07 +0930
committerMatthew Draper <matthew@trebex.net>2015-07-09 03:31:30 +0930
commit383fed5f232630c198847ec573821ede4cf267a9 (patch)
treee55cca58cf30b7dd03ca5506b9e99ab103677673 /railties/lib/rails/application/default_middleware_stack.rb
parentc37d47e30897762145835e66ae752cce924af01d (diff)
downloadrails-383fed5f232630c198847ec573821ede4cf267a9.tar.gz
rails-383fed5f232630c198847ec573821ede4cf267a9.tar.bz2
rails-383fed5f232630c198847ec573821ede4cf267a9.zip
Rely on the load interlock for non-caching reloads, too
Diffstat (limited to 'railties/lib/rails/application/default_middleware_stack.rb')
-rw-r--r--railties/lib/rails/application/default_middleware_stack.rb22
1 files changed, 7 insertions, 15 deletions
diff --git a/railties/lib/rails/application/default_middleware_stack.rb b/railties/lib/rails/application/default_middleware_stack.rb
index 14ea073039..88eade5c5a 100644
--- a/railties/lib/rails/application/default_middleware_stack.rb
+++ b/railties/lib/rails/application/default_middleware_stack.rb
@@ -32,26 +32,18 @@ module Rails
middleware.use ::Rack::Lock
- elsif config.allow_concurrency
- # Do nothing, even if we know this is dangerous
+ elsif config.allow_concurrency == :unsafe
+ # Do nothing, even if we know this is dangerous. This is the
+ # historical behaviour for true.
else
- # Default concurrency setting
+ # Default concurrency setting: enabled, but safe
- if config.cache_classes && config.eager_load
- # No lock required
-
- elsif config.cache_classes
- # The load interlock is required, but not a full request
- # lock
+ unless config.cache_classes && config.eager_load
+ # Without cache_classes + eager_load, the load interlock
+ # is required for proper operation
middleware.use ::ActionDispatch::LoadInterlock
-
- else
- # If we're reloading on each request, they all need to be
- # run in isolation
-
- middleware.use ::Rack::Lock
end
end