lib/vcr/middleware/rack.rb in vcr-1.9.0 vs lib/vcr/middleware/rack.rb in vcr-1.10.0
- old
+ new
@@ -1,12 +1,19 @@
module VCR
module Middleware
class Rack
include Common
+ def initialize(*args)
+ @mutex = Mutex.new
+ super
+ end
+
def call(env)
- VCR.use_cassette(*cassette_arguments(env)) do
- @app.call(env)
+ @mutex.synchronize do
+ VCR.use_cassette(*cassette_arguments(env)) do
+ @app.call(env)
+ end
end
end
end
end
end