summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hill <tomlikestorock@gmail.com>2012-01-20 10:31:35 -0800
committerThomas Hill <tomlikestorock@gmail.com>2012-01-20 10:31:35 -0800
commit1d7428db43c6b5312d74294da9fbd236a84c3dc7 (patch)
tree6b8eba034c9939c1242cbb92a68628c0fb150c14
parent87233a673f112a72c2d778868d413991a9fb1470 (diff)
downloadpyramid-1d7428db43c6b5312d74294da9fbd236a84c3dc7.tar.gz
pyramid-1d7428db43c6b5312d74294da9fbd236a84c3dc7.tar.bz2
pyramid-1d7428db43c6b5312d74294da9fbd236a84c3dc7.zip
Adding app_spec to list of files that trigger restart
-rw-r--r--pyramid/scripts/pserve.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py
index a73cbde3a..9cb7bd92d 100644
--- a/pyramid/scripts/pserve.py
+++ b/pyramid/scripts/pserve.py
@@ -173,7 +173,7 @@ class PServeCommand(object):
if os.environ.get(self._reloader_environ_key):
if self.verbose > 1:
self.out('Running reloading file monitor')
- install_reloader(int(self.options.reload_interval))
+ install_reloader(int(self.options.reload_interval), [app_spec])
# if self.requires_config_file:
# watch_file(self.args[0])
else:
@@ -667,7 +667,7 @@ def _turn_sigterm_into_systemexit(): # pragma: no cover
raise SystemExit
signal.signal(signal.SIGTERM, handle_term)
-def install_reloader(poll_interval=1): # pragma: no cover
+def install_reloader(poll_interval=1, extra_files=[]): # pragma: no cover
"""
Install the reloading monitor.
@@ -677,6 +677,7 @@ def install_reloader(poll_interval=1): # pragma: no cover
which causes the whole application to shut-down (rudely).
"""
mon = Monitor(poll_interval=poll_interval)
+ mon.extra_files.extend(extra_files)
t = threading.Thread(target=mon.periodic_reload)
t.setDaemon(True)
t.start()