File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
hydra-node/src/Hydra/Network Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,7 @@ import Cardano.Binary (decodeFull', serialize')
44
44
import Cardano.Crypto.Hash (SHA256 , hashToStringAsHex , hashWithSerialiser )
45
45
import Control.Concurrent.Class.MonadSTM (
46
46
MonadLabelledSTM ,
47
- labelTVarIO ,
48
47
modifyTVar' ,
49
- newTBQueueIO ,
50
- newTVarIO ,
51
48
peekTBQueue ,
52
49
readTBQueue ,
53
50
swapTVar ,
@@ -579,16 +576,15 @@ newPersistentQueue path capacity = do
579
576
paths <- liftIO $ do
580
577
createDirectoryIfMissing True path
581
578
sort . mapMaybe readMaybe <$> listDirectory path
582
- queue <- newTBQueueIO $ max (fromIntegral $ length paths) capacity
579
+ queue <- newLabelledTBQueueIO " persistent-queue " $ max (fromIntegral $ length paths) capacity
583
580
highestId <-
584
581
try (loadExisting queue paths) >>= \ case
585
582
Left (_ :: IOException ) -> do
586
583
-- XXX: This swallows and not logs the error
587
584
liftIO $ createDirectoryIfMissing True path
588
585
pure 0
589
586
Right highest -> pure highest
590
- nextIx <- newTVarIO $ highestId + 1
591
- labelTVarIO nextIx " persistent-next-ix"
587
+ nextIx <- newLabelledTVarIO " persistent-next-ix" $ highestId + 1
592
588
pure PersistentQueue {queue, nextIx, directory = path}
593
589
where
594
590
loadExisting queue = \ case
You can’t perform that action at this time.
0 commit comments