It makes more sense to force this off into a thread. We're not eager anyway, so there's no reason to chance blocking the main thread.

pull/2175/head
jMyles 2020-07-15 16:39:19 -07:00
parent 8b3b04f3dd
commit ac4117485b
1 changed files with 3 additions and 1 deletions

View File

@ -478,7 +478,9 @@ class Learner:
Continually learn about new nodes.
"""
# TODO: Allow the user to set eagerness? 1712
self.learn_from_teacher_node(eager=False)
# TODO: Also, if we do allow eager, don't even defer; block right here.
d = deferToThread(self.learn_from_teacher_node, eager=False)
return d
def learn_about_specific_nodes(self, addresses: Set):
self._node_ids_to_learn_about_immediately.update(addresses) # hmmmm