Skip reload on attribute changes

This commit is contained in:
shortcutme 2019-07-17 16:30:56 +02:00
parent 314c8b22db
commit 149278abd0
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 3 additions and 0 deletions

View File

@ -44,6 +44,9 @@ class DebugReloader:
self.last_chaged = time.time()
time_modified = os.path.getmtime(path)
self.log.debug("File changed: %s reloading source code (modified %.3fs ago)" % (evt, time.time() - time_modified))
if time.time() - time_modified > 5: # Probably it's just an attribute change, ignore it
return False
time.sleep(0.1) # Wait for lock release
for callback in self.callbacks:
try: