From a3d4ea41c951fd6e53c0da51aa4136e780fe9a64 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Fri, 18 Oct 2019 14:59:01 -0400 Subject: Clean up "gc:bt-peers" thread. --- dht/src/Network/BitTorrent/MainlineDHT.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dht/src') diff --git a/dht/src/Network/BitTorrent/MainlineDHT.hs b/dht/src/Network/BitTorrent/MainlineDHT.hs index af618ba4..2ea2551e 100644 --- a/dht/src/Network/BitTorrent/MainlineDHT.hs +++ b/dht/src/Network/BitTorrent/MainlineDHT.hs @@ -659,13 +659,14 @@ newClient swarms addr = do refresh_thread4 <- forkPollForRefresh $ refresher4 routing refresh_thread6 <- forkPollForRefresh $ refresher6 routing - forkAnnouncedInfohashesGC (contactInfo swarms) + gc_peers <- forkAnnouncedInfohashesGC (contactInfo swarms) return (client, routing, bootstrap (refresher4 routing), bootstrap (refresher6 routing) , do killThread refresh_thread4 -- TODO: Better termination mechanism. killThread refresh_thread6 -- TODO: Better termination mechanism. atomically $ writeTChan addr4 Nothing -- Terminate "addr4" thread. atomically $ writeTChan addr6 Nothing -- Terminate "addr6" thread. + killThread gc_peers ) -- Note that you should call .put() every hour for content that you want to -- cgit v1.2.3