From c37d47e30897762145835e66ae752cce924af01d Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Tue, 30 Sep 2014 01:32:42 +0930 Subject: Soften the lock requirements when eager_load is disabled We don't need to fully disable concurrent requests: just ensure that loads are performed in isolation. --- actionpack/lib/action_dispatch/middleware/load_interlock.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 actionpack/lib/action_dispatch/middleware/load_interlock.rb (limited to 'actionpack/lib/action_dispatch/middleware/load_interlock.rb') diff --git a/actionpack/lib/action_dispatch/middleware/load_interlock.rb b/actionpack/lib/action_dispatch/middleware/load_interlock.rb new file mode 100644 index 0000000000..cbe8d750fe --- /dev/null +++ b/actionpack/lib/action_dispatch/middleware/load_interlock.rb @@ -0,0 +1,12 @@ +require 'active_support/dependencies' +require 'rack/lock' + +module ActionDispatch + class LoadInterlock < ::Rack::Lock + FLAG = 'activesupport.dependency_race'.freeze + + def initialize(app, mutex = ::ActiveSupport::Dependencies.interlock) + super + end + end +end -- cgit v1.2.3