Changeset - 3ca103d97f98
[Not reviewed]
default
0 1 0
Drew Perttula - 8 years ago 2017-05-19 07:48:32
drewp@bigasterisk.com
rdfdb don't error on dropping gone clients (even though that does seem like a bug)
Ignore-this: d338eb86ee04305903e1803f789a27
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
bin/rdfdb
Show inline comments
 
@@ -319,25 +319,26 @@ class Db(object):
 
        senderUpdateUri = getattr(p, 'senderUpdateUri', None)
 

	
 
        for c in self.clients:
 
            if c.updateUri == senderUpdateUri:
 
                # this client has self-applied the patch already
 
                continue
 
            d = c.sendPatch(p)
 
            d.addErrback(self.clientErrored, c)
 
        
 
    def clientErrored(self, err, c):
 
        err.trap(twisted.internet.error.ConnectError, WebsocketDisconnect)
 
        log.info("%r %r - dropping client", c, err.getErrorMessage())
 
        self.clients.remove(c)
 
        if c in self.clients:
 
            self.clients.remove(c)
 
        self.sendClientsToAllLivePages()
 

	
 
    def summarizeToLog(self):
 
        log.info("contexts in graph (%s total stmts):" % len(self.graph))
 
        for c in self.graph.contexts():
 
            log.info("  %s: %s statements" %
 
                     (c.identifier, len(self.getSubgraph(c.identifier))))
 

	
 
    def getSubgraph(self, uri):
 
        """
 
        this is meant to return a live view of the given subgraph, but
 
        if i'm still working around an rdflib bug, it might return a
0 comments (0 inline, 0 general)