summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Martini <seb@dbzteam.org>2012-06-07 00:11:35 +0200
committerSebastien Martini <seb@dbzteam.org>2012-06-07 00:11:35 +0200
commit439565e3a378ed891c03efb0ac181cf9509c99fc (patch)
tree078110f893f2d410533e3cf178035cbb6731f694
parent2a9cc459d0abb7f519e6cc6c25caaa19a6f4446b (diff)
downloadpyinotify-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-xpython2/pyinotify.py5
-rwxr-xr-xpython3/pyinotify.py5
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,