Don't add subdirectory watches if the platform's notifier doesn't require them. refs #2559

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2015-10-30 02:04:30 +00:00 committed by Brian Warner
parent 6bb0963197
commit ea14b1bebe
2 changed files with 4 additions and 1 deletions

View File

@ -351,7 +351,9 @@ class Uploader(QueueMixin):
self.warn("WARNING: cannot upload symlink %s" % quote_filepath(fp))
return None
elif pathinfo.isdir:
if not getattr(self._notifier, 'recursive_includes_new_subdirectories', False):
self._notifier.watch(fp, mask=self.mask, callbacks=[self._notify], recursive=True)
uploadable = Data("", self._client.convergence)
encoded_path_u += magicpath.path2magic(u"/")
upload_d = self._upload_dirnode.add_file(encoded_path_u, uploadable, metadata={"version":0}, overwrite=True)

View File

@ -201,6 +201,7 @@ class INotify(PollMixin):
self._path = None
self._pending = set()
self._pending_delay = 1.0
self.recursive_includes_new_subdirectories = True
def set_pending_delay(self, delay):
self._pending_delay = delay