File tree 1 file changed +6
-4
lines changed
cardano-db-sync/src/Cardano/DbSync/Ledger
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -332,10 +332,12 @@ storeSnapshotAndCleanupMaybe env oldState appResult blkNo isCons syncState =
332
332
case maybeFromStrict (apNewEpoch appResult) of
333
333
Just newEpoch
334
334
| newEpochNo <- unEpochNo (Generic. neEpoch newEpoch)
335
- , newEpochNo > 0 -> do
336
- -- TODO: Instead of newEpochNo - 1, is there any way to get the epochNo from 'lssOldState'?
337
- liftIO $ saveCleanupState env oldState (Just $ EpochNo $ newEpochNo - 1 )
338
- pure True
335
+ , newEpochNo > 0
336
+ , isCons || (newEpochNo `mod` 10 == 0 ) || newEpochNo >= 503 ->
337
+ do
338
+ -- TODO: Instead of newEpochNo - 1, is there any way to get the epochNo from 'lssOldState'?
339
+ liftIO $ saveCleanupState env oldState (Just $ EpochNo $ newEpochNo - 1 )
340
+ pure True
339
341
_ ->
340
342
if timeToSnapshot syncState blkNo && isCons
341
343
then do
You can’t perform that action at this time.
0 commit comments