From c507b786565e5c00387620a560447ac3c586e287 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Thu, 14 Mar 2019 09:47:15 -0400 Subject: [PATCH] Always fire the hook in case someone is waiting. --- src/allmydata/frontends/magic_folder.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index 4a20abc5a..6115528dc 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -1282,6 +1282,12 @@ class Uploader(QueueMixin): else: self._add_pending(relpath_u) self._call_hook(path, 'inotify') + + # Always fire the inotify hook. If an accident of timing causes a + # second inotify event for a particular path before the first has + # been processed, the expectation is still that any code that was + # waiting for the second inotify event should be notified. + self._call_hook(path, 'inotify') action.add_success_fields(**success_fields) def _process(self, item):