From 792064a4aeeab887d7ffcc9dda3fbd8f22488c82 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 25 May 2009 21:00:03 -0700 Subject: Only refresh the gem list when building the app No point in refreshing the list of gems unless the app can actually be reloaded. --- lib/unicorn.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 1ca0113..da41399 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -582,11 +582,13 @@ module Unicorn end def build_app! - if defined?(Gem) && Gem.respond_to?(:refresh) - logger.info "Refreshing Gem list" - Gem.refresh + if @app.respond_to?(:arity) && @app.arity == 0 + if defined?(Gem) && Gem.respond_to?(:refresh) + logger.info "Refreshing Gem list" + Gem.refresh + end + @app = @app.call end - @app = @app.call if @app.respond_to?(:arity) && @app.arity == 0 end def proc_name(tag) -- cgit v1.2.3-24-ge0c7