X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/22b4755242c39bc8e948e4b714bea80433882a11..220025b91505015253464e09e0d1e3aab26ac294:/svc/watch.in diff --git a/svc/watch.in b/svc/watch.in index e058ed8e..97a12bfd 100644 --- a/svc/watch.in +++ b/svc/watch.in @@ -525,6 +525,7 @@ class Pinger (T.Coroutine): installed, and again by the dbwatcher coroutine when it detects a change to the database. """ + if T._debug: print '# rescan peers' correct = {} for peer in S.list(): try: @@ -532,19 +533,23 @@ class Pinger (T.Coroutine): except KeyError: continue if boolean(info, 'watch', False): + if T._debug: print '# interesting peer %s' % peer correct[peer] = info for peer, obj in me._peers.items(): if peer in correct: obj.update(correct[peer]) else: + if T._debug: print '# peer %s vanished' % peer del me._peers[peer] for peer, info in correct.iteritems(): if peer not in me._peers: if startup: + if T._debug: print '# setting up peer %s' % peer ifname = S.ifname(peer) addr = S.addr(peer) T.defer(addpeer, info, peer, ifname, *addr) else: + if T._debug: print '# adopting new peer %s' % peer me.add(peer, info, True) return me