about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-04-24 02:45:21 +0000
committerEric Wong <e@80x24.org>2015-04-24 03:00:32 +0000
commitd33d32fe87645e35ad0d0f3438bce9ba8a649da8 (patch)
tree8c54df8b71495b5c35a240c356d5c6423af3f972
parent3bdf5481e49d76b4502c51e5bdd93f68bfd1f0b4 (diff)
rack 1.6 added a TempfileReaper middleware to cleanup temporary
files.  Enable it by default for users running rack 1.6 or later
to avoid leaving temporary files around.
-rw-r--r--lib/unicorn.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index 638b846..358748f 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -67,6 +67,7 @@ module Unicorn
           use Rack::CommonLogger, $stderr
           use Rack::ShowExceptions
           use Rack::Lint
+          use Rack::TempfileReaper if Rack.const_defined?(:TempfileReaper)
           run inner_app
         end.to_app
       when "deployment"
@@ -74,6 +75,7 @@ module Unicorn
           use Rack::ContentLength
           use Rack::Chunked
           use Rack::CommonLogger, $stderr
+          use Rack::TempfileReaper if Rack.const_defined?(:TempfileReaper)
           run inner_app
         end.to_app
       else