Don't reload source on changes in Test directory

This commit is contained in:
shortcutme 2017-01-27 13:06:09 +01:00
parent d65c7d05a4
commit 32c63fb140
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -40,9 +40,11 @@ class DebugReloader:
if (
not evt.path or "%s/" % config.data_dir in evt.path or
(not evt.path.endswith("py") and not evt.path.endswith("json")) or
"Test" in evt.path or
time.time() - self.last_chaged < 1
):
return False # Ignore *.pyc changes and no reload within 1 sec
time.sleep(0.1) # Wait for lock release
logging.debug("Changed: %s, reloading source." % evt.path)
self.callback()
self.last_chaged = time.time()