From e9b4a65d9c8b2ddb133529e3021a52a81feb1fba Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Wed, 21 Feb 2024 13:53:50 +0100 Subject: [PATCH] Don't run forever in the worker thread --- kore-rpc-types/src/Kore/JsonRpc/Server.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kore-rpc-types/src/Kore/JsonRpc/Server.hs b/kore-rpc-types/src/Kore/JsonRpc/Server.hs index ea09b9cc5a..fe3d8b7cf2 100644 --- a/kore-rpc-types/src/Kore/JsonRpc/Server.hs +++ b/kore-rpc-types/src/Kore/JsonRpc/Server.hs @@ -18,7 +18,7 @@ import Control.Concurrent (forkIO, throwTo) import Control.Concurrent.STM qualified as GHC import Control.Concurrent.STM.TChan (newTChan, readTChan, writeTChan) import Control.Exception (Exception (fromException), catch, mask, throw) -import Control.Monad (forM, forM_, forever) +import Control.Monad (forM, forM_) import Control.Monad.IO.Class (MonadIO (liftIO)) import Control.Monad.Logger (MonadLoggerIO) import Control.Monad.Logger qualified as Log @@ -205,7 +205,7 @@ srv respond handlers = do liftIO $ forkIO $ - forever $ + id $ bracketOnReqException (atomically $ readTChan reqQueue) (withLog . processReq)