Merge branch '0.11'

pull/2676/head
sebres 2020-03-13 23:23:32 +01:00
commit 6e570b8644
1 changed files with 6 additions and 5 deletions

View File

@ -188,7 +188,8 @@ class FilterPyinotify(FileFilter):
for path, isDir in found.iteritems(): for path, isDir in found.iteritems():
self._delPending(path) self._delPending(path)
# refresh monitoring of this: # refresh monitoring of this:
self._refreshWatcher(path, isDir=isDir) if isDir is not None:
self._refreshWatcher(path, isDir=isDir)
if isDir: if isDir:
# check all files belong to this dir: # check all files belong to this dir:
for logpath in self.__watchFiles: for logpath in self.__watchFiles:
@ -276,8 +277,8 @@ class FilterPyinotify(FileFilter):
# we can execute it right now: # we can execute it right now:
self._process_file(path) self._process_file(path)
else: else:
# retard until filter gets started: # retard until filter gets started, isDir=None signals special case: process file only (don't need to refresh monitor):
self._addPending(path, ('INITIAL', path)) self._addPending(path, ('INITIAL', path), isDir=None)
## ##
# Delete a log path # Delete a log path
@ -285,9 +286,9 @@ class FilterPyinotify(FileFilter):
# @param path the log file to delete # @param path the log file to delete
def _delLogPath(self, path): def _delLogPath(self, path):
self._delPending(path)
if not self._delFileWatcher(path): # pragma: no cover if not self._delFileWatcher(path): # pragma: no cover
logSys.error("Failed to remove watch on path: %s", path) logSys.error("Failed to remove watch on path: %s", path)
self._delPending(path)
path_dir = dirname(path) path_dir = dirname(path)
for k in self.__watchFiles: for k in self.__watchFiles:
@ -297,8 +298,8 @@ class FilterPyinotify(FileFilter):
if path_dir: if path_dir:
# Remove watches for the directory # Remove watches for the directory
# since there is no other monitored file under this directory # since there is no other monitored file under this directory
self._delDirWatcher(path_dir)
self._delPending(path_dir) self._delPending(path_dir)
self._delDirWatcher(path_dir)
# pyinotify.ProcessEvent default handler: # pyinotify.ProcessEvent default handler:
def __process_default(self, event): def __process_default(self, event):