diff --git a/hbs2-storage-ncq/lib/HBS2/Storage/NCQ2.hs b/hbs2-storage-ncq/lib/HBS2/Storage/NCQ2.hs index 41e9183c..782cbefc 100644 --- a/hbs2-storage-ncq/lib/HBS2/Storage/NCQ2.hs +++ b/hbs2-storage-ncq/lib/HBS2/Storage/NCQ2.hs @@ -343,10 +343,9 @@ ncqStorageRun2 :: forall m . MonadUnliftIO m -> m () ncqStorageRun2 ncq@NCQStorage2{..} = flip runContT pure do - jobQ <- newTQueueIO closeQ <- newTQueueIO - closer <- ContT $ withAsync $ liftIO $ fix \loop -> do + closer <- spawnActivity $ liftIO $ fix \loop -> do what <- atomically do stop <- readTVar ncqStorageStopReq tryReadTQueue closeQ >>= \case @@ -367,8 +366,6 @@ ncqStorageRun2 ncq@NCQStorage2{..} = flip runContT pure do ncqAlterEntrySTM ncq (coerce k) (const Nothing) loop - link closer - spawnActivity $ forever (liftIO $ join $ atomically (readTQueue ncqJobQ)) spawnActivity measureWPS