Skip to content

Commit

Permalink
Make sure load_wsgi() is called after starting the reloader (benoitc#…
Browse files Browse the repository at this point in the history
  • Loading branch information
daker authored and berkerpeksag committed Dec 12, 2016
1 parent 4d6af53 commit efee207
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gunicorn/workers/base.py
Expand Up @@ -112,8 +112,6 @@ def init_process(self):

self.init_signals()

self.load_wsgi()

# start the reloader
if self.cfg.reload and self.cfg.reload != 'off':
def changed(fname):
Expand All @@ -133,6 +131,7 @@ def changed(fname):
self.reloader = reloader_cls(callback=changed)
self.reloader.start()

self.load_wsgi()
self.cfg.post_worker_init(self)

# Enter main run loop
Expand All @@ -143,7 +142,7 @@ def load_wsgi(self):
try:
self.wsgi = self.app.wsgi()
except SyntaxError as e:
if not self.cfg.reload:
if self.cfg.reload == 'off':
raise

self.log.exception(e)
Expand Down

0 comments on commit efee207

Please sign in to comment.