changeset 807:3fe281a3be70

rdfdb: try different inotify event mask to not miss events Ignore-this: 2845e718db6e7d313af8f454a1e05a8
author drewp@bigasterisk.com
date Wed, 18 Jul 2012 18:08:12 +0000
parents 6d8f0c088a26
children a631e075a5bf
files light9/rdfdb/graphfile.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/light9/rdfdb/graphfile.py	Wed Jul 18 18:07:49 2012 +0000
+++ b/light9/rdfdb/graphfile.py	Wed Jul 18 18:08:12 2012 +0000
@@ -1,5 +1,6 @@
 import logging, traceback
 from twisted.python.filepath import FilePath
+from twisted.internet.inotify import IN_CLOSE_WRITE, IN_MOVED_FROM
 from rdflib import Graph
 from light9.rdfdb.patch import Patch
 
@@ -13,7 +14,9 @@
         self.path, self.uri = path, uri
         self.patch, self.getSubgraph = patch, getSubgraph
 
-        notifier.watch(FilePath(path), callbacks=[self.notify])
+        notifier.watch(FilePath(path),
+                       mask=IN_CLOSE_WRITE | IN_MOVED_FROM,
+                       callbacks=[self.notify])
         self.reread()
       
     def notify(self, notifier, filepath, mask):