about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-05-25 20:29:55 -0700
committerEric Wong <normalperson@yhbt.net>2009-05-25 20:32:34 -0700
commit8fc898a63e742190903d331958d3b6627f819624 (patch)
tree8956a082e64bbc1287b4eadb27267b71948c1ce9
parent2c6f625b6cb46be5c2dfc056680ba8dc2c19e334 (diff)
downloadunicorn-8fc898a63e742190903d331958d3b6627f819624.tar.gz
On application reloads, Gems installed by the Ruby instance may
be different than when Unicorn started.  So when preload_app is
false, HUP-ing Unicorn will always refresh the list of Gems
before loading the application code.
-rw-r--r--lib/unicorn.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index 4a4e2e1..1ca0113 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -582,6 +582,10 @@ module Unicorn
     end
 
     def build_app!
+      if defined?(Gem) && Gem.respond_to?(:refresh)
+        logger.info "Refreshing Gem list"
+        Gem.refresh
+      end
       @app = @app.call if @app.respond_to?(:arity) && @app.arity == 0
     end