about summary refs log tree commit homepage
path: root/lib/unicorn.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-04-08 18:05:43 -0700
committerEric Wong <normalperson@yhbt.net>2010-04-08 18:05:43 -0700
commit22e3ed4de0e89b97dac91c95c796eb8a7f93e5de (patch)
tree4b9a25a1aed51d6d4cce4fa84988db46e9712474 /lib/unicorn.rb
parent0792b37d5e28d3ea1585d5837682cde4d0319a8a (diff)
downloadunicorn-22e3ed4de0e89b97dac91c95c796eb8a7f93e5de.tar.gz
This will help ensure we use the same version of Rack the
application uses and avoid loading conflicting/incompatible
versions.
Diffstat (limited to 'lib/unicorn.rb')
-rw-r--r--lib/unicorn.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index b63abeb..75ce09d 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -800,15 +800,15 @@ module Unicorn
 
     def build_app!
       if app.respond_to?(:arity) && app.arity == 0
-        # exploit COW in case of preload_app.  Also avoids race
-        # conditions in Rainbows! since load/require are not thread-safe
-        Unicorn.constants.each { |x| Unicorn.const_get(x) }
-
         if defined?(Gem) && Gem.respond_to?(:refresh)
           logger.info "Refreshing Gem list"
           Gem.refresh
         end
         self.app = app.call
+
+        # exploit COW in case of preload_app.  Also avoids race
+        # conditions in Rainbows! since load/require are not thread-safe
+        Unicorn.constants.each { |x| Unicorn.const_get(x) }
       end
     end