mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-20 13:28:20 +02:00
Fix peer server thread shutdown (#903)
This commit is contained in:
parent
7d266cdf5e
commit
36d89bd25e
8 changed files with 53 additions and 10 deletions
|
|
@ -13,6 +13,7 @@ class ProcessReceivedPaymentsWorker:
|
|||
threading.Thread(
|
||||
target=self.process_subscribed_invoices,
|
||||
# daemon=True,
|
||||
name="process_received_payments_thread",
|
||||
).start()
|
||||
|
||||
def process_subscribed_invoices(self):
|
||||
|
|
|
|||
|
|
@ -143,6 +143,9 @@ class SqueakNode:
|
|||
def stop_running(self):
|
||||
self.stopped.set()
|
||||
|
||||
# TODO: Use explicit stop to stop all components
|
||||
self.peer_server.stop()
|
||||
|
||||
|
||||
def load_lightning_client(config) -> LNDLightningClient:
|
||||
return LNDLightningClient(
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class SqueakOfferExpiryWorker:
|
|||
self.start_running,
|
||||
)
|
||||
timer.daemon = True
|
||||
timer.name = "squeak_offer_expiry_thread"
|
||||
timer.start()
|
||||
self.remove_expired_offers()
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ class SqueakPeerSyncWorker:
|
|||
|
||||
def sync_timeline(self):
|
||||
logger.info("Syncing timeline with peers...")
|
||||
self.print_running_threads()
|
||||
self.squeak_controller.sync_timeline()
|
||||
self.squeak_controller.share_squeaks()
|
||||
|
||||
|
|
@ -27,5 +28,10 @@ class SqueakPeerSyncWorker:
|
|||
self.start_running,
|
||||
)
|
||||
timer.daemon = True
|
||||
timer.name = "squeak_peer_sync_thread"
|
||||
timer.start()
|
||||
self.sync_timeline()
|
||||
|
||||
def print_running_threads(self):
|
||||
for thread in threading.enumerate():
|
||||
print(thread.name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue