Changeset - 5db651b08d77
[Not reviewed]
default
0 1 0
Drew Perttula - 8 years ago 2017-05-30 07:38:04
drewp@bigasterisk.com
syncedgraph log traceback on a handler exception
Ignore-this: 26b425864acaf1eb479ab9d68855c07e
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/rdfdb/autodepgraphapi.py
Show inline comments
 
@@ -36,25 +36,30 @@ class AutoDepGraphApi(object):
 

	
 
        # if one handler func calls another, does that break anything?
 
        # maybe not?
 

	
 
        # no plan for sparql queries yet. Hook into a lower layer that
 
        # reveals all their statement fetches? Just make them always
 
        # new? Cache their results, so if i make the query again and
 
        # it gives the same result, I don't call the handler?
 

	
 
        self.currentFuncs.append(func)
 
        log.debug('graph.currentFuncs push %s', func)
 
        try:
 
            func()
 
            try:
 
                func()
 
            except:
 
                import traceback
 
                traceback.print_exc()
 
                raise
 
        finally:
 
            self.currentFuncs.pop()
 
            log.debug('graph.currentFuncs pop %s. stack now has %s', func, len(self.currentFuncs))
 

	
 
    def runDepsOnNewPatch(self, p):
 
        """
 
        patch p just happened to the graph; call everyone back who
 
        might care, and then notice what data they depend on now
 
        """
 
        for func in self._watchers.whoCares(p):
 
            # todo: forget the old handlers for this func
 
            log.debug('runDepsOnNewPatch calling watcher %s', p)
0 comments (0 inline, 0 general)