From 8fc898a63e742190903d331958d3b6627f819624 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 25 May 2009 20:29:55 -0700 Subject: Refresh Gem list when building the app 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. --- lib/unicorn.rb | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3-24-ge0c7