Stop Alice's publication threadpool in disenchant().

pull/2175/head
jMyles 2020-07-17 19:36:57 -07:00
parent c9d176e972
commit e7e710bb36
2 changed files with 7 additions and 3 deletions

View File

@ -133,7 +133,6 @@ class Alice(Character, BlockchainPolicyAuthor):
self.publication_threadpool = ThreadPool(maxthreads=120, name="Alice Policy Publication") # In the future, this value is perhaps best set to something like 3-4 times the optimal "high n", whatever we determine that to be.
self.publication_threadpool.start()
reactor.addSystemEventTrigger("before", "shutdown", self.publication_threadpool.stop) # TODO: Congregate Character Stop activity.
else:
self.m = STRANGER_ALICE
self.n = STRANGER_ALICE
@ -445,6 +444,11 @@ class Alice(Character, BlockchainPolicyAuthor):
return controller
def disenchant(self):
super().disenchant()
self.publication_threadpool.stop()
class Bob(Character):
banner = BOB_BANNER

View File

@ -344,14 +344,14 @@ def random_policy_label():
def federated_alice(alice_federated_test_config):
alice = alice_federated_test_config.produce()
yield alice
alice.publication_threadpool.stop()
alice.disenchant()
@pytest.fixture(scope="module")
def blockchain_alice(alice_blockchain_test_config, testerchain):
alice = alice_blockchain_test_config.produce()
yield alice
alice.publication_threadpool.stop()
alice.disenchant()
@pytest.fixture(scope="module")