From 9cd24713e1e51dbc0834148332ce03f43628b4b5 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Wed, 18 Mar 2015 00:47:40 +0000 Subject: [PATCH] WIP: workaround for duplicate events on Windows. refs #2220 Signed-off-by: Daira Hopwood --- src/allmydata/windows/inotify.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/allmydata/windows/inotify.py b/src/allmydata/windows/inotify.py index 67c5823a..ecebbc1f 100644 --- a/src/allmydata/windows/inotify.py +++ b/src/allmydata/windows/inotify.py @@ -248,21 +248,20 @@ class INotify(PollMixin): return path = self._path.preauthChild(info.filename) # FilePath with Unicode path - mask = _action_to_inotify_mask.get(info.action, IN_CHANGED) + #mask = _action_to_inotify_mask.get(info.action, IN_CHANGED) - def _maybe_notify(path, mask): - event = (path, mask) - if event not in self._pending: - self._pending.add(event) + def _maybe_notify(path): + if path not in self._pending: + self._pending.add(path) def _do_callbacks(): - self._pending.remove(event) + self._pending.remove(path) for cb in self._callbacks: try: - cb(None, path, mask) + cb(None, path, IN_CHANGED) except Exception, e: log.msg(e) reactor.callLater(self._pending_delay, _do_callbacks) - reactor.callFromThread(_maybe_notify, path, mask) + reactor.callFromThread(_maybe_notify, path) except Exception, e: log.msg(e) self.stop = False # pretend we started -- 2.45.2