about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-05-25 21:00:03 -0700
committerEric Wong <normalperson@yhbt.net>2009-05-25 21:00:03 -0700
commit792064a4aeeab887d7ffcc9dda3fbd8f22488c82 (patch)
tree12466149e37e793a5bb4304338c0ee531abb271d
parent8fc898a63e742190903d331958d3b6627f819624 (diff)
downloadunicorn-792064a4aeeab887d7ffcc9dda3fbd8f22488c82.tar.gz
No point in refreshing the list of gems unless the app
can actually be reloaded.
-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)