diff options
author | Sebastien Martini <seb@dbzteam.org> | 2012-06-07 00:11:35 +0200 |
---|---|---|
committer | Sebastien Martini <seb@dbzteam.org> | 2012-06-07 00:11:35 +0200 |
commit | 439565e3a378ed891c03efb0ac181cf9509c99fc (patch) | |
tree | 078110f893f2d410533e3cf178035cbb6731f694 | |
parent | 2a9cc459d0abb7f519e6cc6c25caaa19a6f4446b (diff) | |
download | pyinotify-439565e3a378ed891c03efb0ac181cf9509c99fc.tar.gz |
Don't check for existing watch when setting up watches
This check had prohibitive cost and was useless to some extent
because adding a watch for an already watched path will result
in assigning the same watch descriptor therefore only updating
it. There won't be any dangling watch descriptor left into the
watch manager dictionary.
Issue reported by Jan Knudsen https://github.com/Shne
-rwxr-xr-x | python2/pyinotify.py | 5 | ||||
-rwxr-xr-x | python3/pyinotify.py | 5 |
2 files changed, 0 insertions, 10 deletions
diff --git a/python2/pyinotify.py b/python2/pyinotify.py index cb562c5..ce0d781 100755 --- a/python2/pyinotify.py +++ b/python2/pyinotify.py @@ -1852,11 +1852,6 @@ class WatchManager: for apath in self.__glob(npath, do_glob): # recursively list subdirs according to rec param for rpath in self.__walk_rec(apath, rec): - if self.get_wd(rpath) is not None: - # We decide to ignore paths already inserted into - # the watch manager. Need to be removed with rm_watch() - # first. Or simply call update_watch() to update it. - continue if not exclude_filter(rpath): wd = ret_[rpath] = self.__add_watch(rpath, mask, proc_fun, diff --git a/python3/pyinotify.py b/python3/pyinotify.py index 8d27c1c..bb33c19 100755 --- a/python3/pyinotify.py +++ b/python3/pyinotify.py @@ -1839,11 +1839,6 @@ class WatchManager: for apath in self.__glob(npath, do_glob): # recursively list subdirs according to rec param for rpath in self.__walk_rec(apath, rec): - if self.get_wd(rpath) is not None: - # We decide to ignore paths already inserted into - # the watch manager. Need to be removed with rm_watch() - # first. Or simply call update_watch() to update it. - continue if not exclude_filter(rpath): wd = ret_[rpath] = self.__add_watch(rpath, mask, proc_fun, |