Remove thread from active list when it has finished.

This commit is contained in:
David 2019-03-01 11:31:31 +01:00
commit 176447e389

View file

@ -24,7 +24,7 @@ main = do
forever $ do forever $ do
msg <- receiveData conn :: IO T.Text msg <- receiveData conn :: IO T.Text
stopWorker conn thread stopWorker conn thread
putMVar thread =<< forkIO (generateResponse conn msg) putMVar thread =<< forkIO (generateResponse conn msg >> tryTakeMVar thread >> return ())
where where
opts = defaultConnectionOptions opts = defaultConnectionOptions
{ connectionCompressionOptions = PermessageDeflateCompression defaultPermessageDeflate } { connectionCompressionOptions = PermessageDeflateCompression defaultPermessageDeflate }