Skip to content

Commit 2e79ee4

Browse files
committed
Insert offchain data rarely when syncing
1 parent 3916881 commit 2e79ee4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cardano-db-sync/src/Cardano/DbSync/Api.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,10 @@ mkSyncEnv trce backend connectionString syncOptions protoInfo nw nwMagic systemS
376376
bts <- getBootstrapInProgress trce (enpBootstrap syncNP) backend
377377
bootstrapVar <- newTVarIO bts
378378
-- Offline Pool + Anchor queues
379-
opwq <- newTBQueueIO 100
380-
oprq <- newTBQueueIO 100
381-
oawq <- newTBQueueIO 100
382-
oarq <- newTBQueueIO 100
379+
opwq <- newTBQueueIO 1000
380+
oprq <- newTBQueueIO 1000
381+
oawq <- newTBQueueIO 1000
382+
oarq <- newTBQueueIO 1000
383383
epochVar <- newTVarIO initEpochState
384384
epochSyncTime <- newTVarIO =<< getCurrentTime
385385
ledgerEnvType <-

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@ insertShelleyBlock syncEnv shouldLog withinTwoMins withinHalfHour blk details is
197197

198198
insertStakeSlice syncEnv $ apStakeSlice applyResult
199199

200-
when (ioGov iopts)
200+
when (ioGov iopts && (withinHalfHour || unBlockNo (Generic.blkBlockNo blk) `mod` 10000 == 0))
201201
. lift
202202
$ insertOffChainVoteResults tracer (envOffChainVoteResultQueue syncEnv)
203203

204-
when (ioOffChainPoolData iopts)
204+
when (ioOffChainPoolData iopts && (withinHalfHour || unBlockNo (Generic.blkBlockNo blk) `mod` 10000 == 0))
205205
. lift
206206
$ insertOffChainPoolResults tracer (envOffChainPoolResultQueue syncEnv)
207207
where

0 commit comments

Comments
 (0)