jaddison/django-multihost — pull request #5 by dannyclark (2012-06-02 13:58:20+00:00)
Title: first requests being redirected to default site

Hi,

I had an issue running on gunicorn (with gevent workers + psycogreen) where the first requests after a restart always happen before the app cache is ready, and therefore get redirected to the default site. This is clearly an issue for running multiple independent websites as each time the server is bounced some users will end up being forwarded to the wrong site.

I'm submitting a patch that changes the behaviour slightly so the lookup is still done if the app cache is not ready, but obviously it doesn't then attempt to cache the results. Would be grateful if you'd consider including it.

Thanks,
Dan Clark.