From: Daira Hopwood Date: Wed, 6 May 2015 14:32:16 +0000 (+0100) Subject: Don't add subdirectory watches on Windows. X-Git-Url: https://git.rkrishnan.org/?a=commitdiff_plain;h=1ee26c300f61c1816fe9eb13e020ff49f261d9b0;p=tahoe-lafs%2Ftahoe-lafs.git Don't add subdirectory watches on Windows. Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/frontends/drop_upload.py b/src/allmydata/frontends/drop_upload.py index 8bcb03d7..38f51ba2 100644 --- a/src/allmydata/frontends/drop_upload.py +++ b/src/allmydata/frontends/drop_upload.py @@ -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)