From 1ee26c300f61c1816fe9eb13e020ff49f261d9b0 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Wed, 6 May 2015 15:32:16 +0100 Subject: [PATCH] Don't add subdirectory watches on Windows. Signed-off-by: Daira Hopwood --- src/allmydata/frontends/drop_upload.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) -- 2.45.2