Skip to content

Commit 97546e7

Browse files
committed
Run insertValidateShelleyGenesisDist through a pg transaction
1 parent c1ffee7 commit 97546e7

File tree

1 file changed

+3
-3
lines changed
  • cardano-db-sync/src/Cardano/DbSync/Era/Shelley

1 file changed

+3
-3
lines changed

cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Genesis.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Cardano.DbSync.Api.Types (InsertOptions (..), SyncEnv (..), SyncOptions (
2020
import Cardano.DbSync.Cache (insertAddressUsingCache, tryUpdateCacheTx)
2121
import Cardano.DbSync.Cache.Epoch (withNoCache)
2222
import Cardano.DbSync.Cache.Types (CacheAction (..))
23-
import Cardano.DbSync.DbEvent (liftDbLookup, runDbSyncNoTransaction, runDbSyncNoTransactionNoLogging)
23+
import Cardano.DbSync.DbEvent (liftDbLookup, runDbSyncTransaction, runDbSyncTransactionNoLogging)
2424
import qualified Cardano.DbSync.Era.Shelley.Generic.Util as Generic
2525
import Cardano.DbSync.Era.Universal.Insert.Certificate (insertDelegation, insertStakeRegistration)
2626
import Cardano.DbSync.Era.Universal.Insert.Other (insertStakeAddressRefIfMissing)
@@ -69,8 +69,8 @@ insertValidateShelleyGenesisDist syncEnv networkName cfg shelleyInitiation = do
6969
throwError SNErrIgnoreShelleyInitiation
7070

7171
case DB.dbTracer $ envDbEnv syncEnv of
72-
Just trce -> ExceptT $ runDbSyncNoTransaction trce (envDbEnv syncEnv) (insertAction prunes)
73-
Nothing -> ExceptT $ runDbSyncNoTransactionNoLogging (envDbEnv syncEnv) (insertAction prunes)
72+
Just trce -> ExceptT $ runDbSyncTransaction trce (envDbEnv syncEnv) (Just DB.ReadCommitted) (insertAction prunes)
73+
Nothing -> ExceptT $ runDbSyncTransactionNoLogging (envDbEnv syncEnv) (insertAction prunes)
7474
where
7575
tracer = getTrace syncEnv
7676

0 commit comments

Comments
 (0)