> In particular, what benefit does this have over putting the same > code in config.ru or config/initializer.rb (or similar?)
With my patch, preload_app yields a rack app object which includes the middleware stack. AFAIK there's no way to do this in the context of config.ru, since the app is still being built. My goal is to warm up the final application that will be serving traffic, including all middleware. On Sat, Sep 21, 2013 at 1:49 AM, Eric Wong <[email protected]> wrote: > Aman Gupta <[email protected]> wrote: > > Thanks for the patch! > > I expect a commit message body to describe why it is useful. > > In particular, what benefit does this have over putting the same > code in config.ru or config/initializer.rb (or similar?) > > For user-visible config changes like these, it can be similar/identical > to the added documentation. > > Anyways, I agree warming up the app is often necessary, but I'm not > convinced it's necessary change unicorn for it. It makes sense > to warmup apps on servers other than unicorn, too. > >> --- a/lib/unicorn/http_server.rb >> +++ b/lib/unicorn/http_server.rb >> @@ -721,6 +721,9 @@ class Unicorn::HttpServer >> Gem.refresh >> end >> self.app = app.call >> + if preload_app.respond_to?(:call) >> + preload_app[app] >> + end > > Since you're testing for respond_to?(:call), it should be less confusing > to use "preload_app.call(app)" here instead of "preload_app[app]" _______________________________________________ Unicorn mailing list - [email protected] http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying
