diff --git a/oml/nodes.py b/oml/nodes.py index 5ba54ee..fd7a6ea 100644 --- a/oml/nodes.py +++ b/oml/nodes.py @@ -44,7 +44,7 @@ class Node(Thread): self._opener = get_opener(self.user_id) self._q = Queue() self._pingcb = PeriodicCallback(self.ping, 10 * settings.server['pull_interval']) - self._pingcb.start() + state.main.add_callback(self._pingcb.start) Thread.__init__(self) self.daemon = True self.start() @@ -512,7 +512,7 @@ class Nodes(Thread): self.queue('add', u.id, True) self.local = LocalNodes() self._pullcb = PeriodicCallback(self.pull, settings.server['pull_interval']) - self._pullcb.start() + state.main.add_callback(self._pingcb.start) Thread.__init__(self) self.daemon = True self.start()