From 90fb09f6182acb8c224e51ac15002e119e05eefd Mon Sep 17 00:00:00 2001 From: Randall Leeds Date: Tue, 6 Aug 2013 03:17:00 -0700 Subject: [PATCH] Don't reload the paster app when run with pserve Using gunicorn with paster command line causes the application to load before gunicorn. In this case, there is no choice but to preload the application. Document this fact. Fixes #528. --- docs/source/run.rst | 5 +++++ gunicorn/app/pasterapp.py | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/source/run.rst b/docs/source/run.rst index 03cc5b1c..1a28346a 100644 --- a/docs/source/run.rst +++ b/docs/source/run.rst @@ -122,3 +122,8 @@ And then as per usual:: $ cd yourpasteproject $ paster serve development.ini workers=2 + +However, in this configuration, Gunicorn does not reload the application when +new workers are started. See the note about preloading_. + +.. _preloading: configure.html#preload-app diff --git a/gunicorn/app/pasterapp.py b/gunicorn/app/pasterapp.py index 7d35b336..e05e3f17 100644 --- a/gunicorn/app/pasterapp.py +++ b/gunicorn/app/pasterapp.py @@ -134,9 +134,6 @@ class PasterServerApplication(PasterBaseApplication): self.load_config_from_file(default_config) def load(self): - if hasattr(self, "cfgfname"): - return loadapp(self.cfgurl, relative_to=self.relpath, global_conf=self.gcfg) - return self.app