about summary refs log tree commit homepage
path: root/lib/unicorn.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/unicorn.rb')
-rw-r--r--lib/unicorn.rb10
1 files 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)