]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Don't add subdirectory watches on Windows.
authorDaira Hopwood <daira@jacaranda.org>
Wed, 6 May 2015 14:32:16 +0000 (15:32 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Fri, 29 May 2015 20:42:56 +0000 (21:42 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/frontends/drop_upload.py

index 8bcb03d7da817c741bc9940549c5532cabf2d21e..38f51ba23336e3f50dd2b7fc1cc5073b8b993f78 100644 (file)
@@ -32,6 +32,9 @@ class DropUploader(service.MultiService):
         self._local_path = to_filepath(self._local_dir)
         self._dbfile = dbfile
 
+        # On Windows, a single recursive watch covers all subdirectories.
+        self._need_subdirectory_watches = sys.platform != "win32"
+
         self._upload_deque = deque()
         self.is_upload_ready = False
 
@@ -182,7 +185,10 @@ class DropUploader(service.MultiService):
             return self._parent.add_file(name, u)
 
         def _add_dir(ignore, name):
-            self._notifier.watch(to_filepath(path), mask=self.mask, callbacks=[self._notify], recursive=True)
+            if self._need_subdirectory_watches:
+                self._notifier.watch(to_filepath(path), mask=self.mask, callbacks=[self._notify],
+                                     recursive=True)
+
             d2 = self._parent.create_subdirectory(name, overwrite=False)
             def _err(f):
                 f.trap(ExistingChildError)