changeset 1083:7aca3145c96e

refactor rdfdb patch() Ignore-this: b4e99ad7be01e4e1f1d28340258a5fb6
author Drew Perttula <drewp@bigasterisk.com>
date Tue, 03 Jun 2014 08:28:10 +0000
parents 9ea123a24320
children 957aecd4d8bc
files bin/rdfdb
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/bin/rdfdb	Tue Jun 03 08:27:49 2014 +0000
+++ b/bin/rdfdb	Tue Jun 03 08:28:10 2014 +0000
@@ -288,6 +288,12 @@
             self.watchedFiles.aboutToPatch(ctx)
         
         patchQuads(self.graph, p.delQuads, p.addQuads, perfect=True)
+        self._sendPatch(p)
+        if not dueToFileChange:
+            self.watchedFiles.dirtyFiles([ctx])
+        sendToLiveClients(asJson=p.jsonRepr)
+
+    def _sendPatch(self, p):
         senderUpdateUri = getattr(p, 'senderUpdateUri', None)
 
         for c in self.clients:
@@ -296,10 +302,7 @@
                 continue
             d = c.sendPatch(p)
             d.addErrback(self.clientErrored, c)
-        if not dueToFileChange:
-            self.watchedFiles.dirtyFiles([ctx])
-        sendToLiveClients(asJson=p.jsonRepr)
-
+        
     def clientErrored(self, err, c):
         err.trap(twisted.internet.error.ConnectError)
         log.info("connection error- dropping client %r" % c)