@@ -19,6 +19,7 @@ module Ouroboros.Consensus.Storage.LedgerDB.V2.Forker
1919 , module Ouroboros.Consensus.Storage.LedgerDB.Forker
2020 ) where
2121
22+ import Control.ResourceRegistry
2223import Control.Tracer
2324import Data.Maybe (fromMaybe )
2425import GHC.Generics
@@ -51,7 +52,7 @@ data ForkerEnv m l blk = ForkerEnv
5152 -- ^ Config
5253 , foeTracer :: ! (Tracer m TraceForkerEvent )
5354 -- ^ Config
54- , foeResourcesToRelease :: ! (StrictTVar m (m () ))
55+ , foeResourcesToRelease :: ! (ResourceKey m , StrictTVar m (m () ))
5556 -- ^ Release the resources
5657 }
5758 deriving Generic
@@ -132,7 +133,7 @@ implForkerPush env newState = do
132133 traceWith (foeTracer env) ForkerPushEnd
133134 atomically $ do
134135 writeTVar (foeLedgerSeq env) lseq'
135- modifyTVar (foeResourcesToRelease env) (>> close newtbs)
136+ modifyTVar (snd $ foeResourcesToRelease env) (>> close newtbs)
136137 )
137138
138139implForkerCommit ::
@@ -171,7 +172,7 @@ implForkerCommit env = do
171172 -- actions for closing the states pushed to the forker. As we are committing
172173 -- those we have to close the ones discarded in this function and forget about
173174 -- those releasing actions.
174- writeTVar foeResourcesToRelease closeDiscarded
175+ writeTVar ( snd foeResourcesToRelease) closeDiscarded
175176 where
176177 ForkerEnv
177178 { foeLedgerSeq
0 commit comments