Handle removed files

This commit is contained in:
ZyX 2013-04-06 18:30:33 +04:00
parent d1d05c9dcf
commit b17dab0cd4
1 changed files with 9 additions and 2 deletions

View File

@ -115,9 +115,16 @@ class ConfigLoader(MultiRunnedThread):
with self.lock:
for path, functions in self.watched.items():
for function in functions:
if self.watcher(path):
try:
modified = self.watcher(path)
except OSError as e:
modified = True
self.exception('Error while running watcher for path {0}: {1}', path, str(e))
else:
if modified:
toload.append(path)
if modified:
function(path)
toload.append(path)
with self.lock:
for key, functions in list(self.missing.items()):
remove = False