Skip to content

Commit

Permalink
fix: thread crash for sql-lite
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan-manole committed Aug 29, 2023
1 parent 3bc656d commit 86445ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Plutus/Certification/Synchronizer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Control.Concurrent (threadDelay)
import Data.Time (UTCTime)
import Data.ByteString (toStrict)
import Data.Text.Encoding (decodeUtf8)
import Control.Monad.Catch (MonadMask)
import Control.Monad.Catch (MonadMask, catchAll)
import Data.List (groupBy)
import Plutus.Certification.API.Routes (RunIDV1(..))
import Plutus.Certification.CoinGeckoClient
Expand Down Expand Up @@ -51,7 +51,7 @@ import qualified IOHK.Certification.Persistence as DB
data InitializingField
= WalletArgsField WalletArgs
| DelayField Int
| ErrorField IOException
| ErrorField SomeException

data SynchronizerSelector f where
InitializingSynchronizer :: SynchronizerSelector InitializingField
Expand Down Expand Up @@ -297,11 +297,11 @@ startTransactionsMonitor' eb scheduleCrash args adaPriceRef delayInSeconds minAs
addField ev $ DelayField delayInSeconds
-- TODO maybe a forkIO here will be better than into the calling function
-- hence, now, the parent instrumentation event will never terminate
catchError
catchAll
(doWork ev)
(catchAndCrash ev)
where
catchAndCrash ev e = do
catchAndCrash ev (e :: SomeException) = do
addField ev (ErrorField e)
let mods = setAncestor $ reference ev
schedule scheduleCrash mods
Expand Down

0 comments on commit 86445ea

Please sign in to comment.