about summary refs log tree commit homepage
path: root/lib/unicorn.rb
diff options
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 /lib/unicorn.rb
parent2c6f625b6cb46be5c2dfc056680ba8dc2c19e334 (diff)
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.
Diffstat (limited to 'lib/unicorn.rb')
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
     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