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 02:50:39 +0000
commitf9d5a1961ab818776546186dbc99e10ae4c527dd (patch)
treeb9d82b4bfa32d9efb4736f0920abaa78b1c65daf
parent1964db56aa6fb7d57fc49cda10714d34c087a398 (diff)
downloadunicorn-f9d5a1961ab818776546186dbc99e10ae4c527dd.tar.gz
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 467245d..9fdcb8e 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -65,6 +65,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"
@@ -72,6 +73,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