]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
WIP: workaround for duplicate events on Windows. refs #2220
authorDaira Hopwood <daira@jacaranda.org>
Wed, 18 Mar 2015 00:47:40 +0000 (00:47 +0000)
committerDaira Hopwood <daira@jacaranda.org>
Wed, 15 Apr 2015 13:25:16 +0000 (14:25 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/windows/inotify.py

index 51d80f140a8aeaaf69d9afbc0be04dfe55cf331a..1a719f9afd9a2fb51fdd96e0ef97ad2c0a270cc1 100644 (file)
@@ -254,21 +254,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.err(e)
                             reactor.callLater(self._pending_delay, _do_callbacks)
-                    reactor.callFromThread(_maybe_notify, path, mask)
+                    reactor.callFromThread(_maybe_notify, path)
         except Exception, e:
             log.err(e)
             self._state = STOPPED