Skip to content

Commit 5c8fc00

Browse files
committed
Read snapshot interval from main toplevel config too
1 parent 1d5598d commit 5c8fc00

File tree

1 file changed

+8
-3
lines changed
  • cardano-node/src/Cardano/Node/Configuration

1 file changed

+8
-3
lines changed

cardano-node/src/Cardano/Node/Configuration/POM.hs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,14 @@ instance FromJSON PartialNodeConfiguration where
436436
(fmap RequestedNumOfDiskSnapshots <$> o .:? "NumOfDiskSnapshots")
437437
.!= DefaultNumOfDiskSnapshots
438438
doChecksum <- (fmap Flag <$> o .:? "DoDiskSnapshotChecksum") .!= DoDiskSnapshotChecksum
439-
snapInterval <-
440-
(fmap (RequestedSnapshotInterval . secondsToDiffTime) <$> o .:? "SnapshotInterval")
441-
.!= DefaultSnapshotInterval
439+
snapInterval <- do
440+
ov <- (fmap (RequestedSnapshotInterval . secondsToDiffTime) <$> o .:? "SnapshotInterval") .!= DefaultSnapshotInterval
441+
case ov of
442+
DefaultSnapshotInterval -> do
443+
-- This is here just to ensure that we also try to read the SnapshotInterval from the toplevel config. as it was the case before UTxO-HD
444+
-- It is needed for the pre-emptive cluster runs
445+
(fmap (RequestedSnapshotInterval . secondsToDiffTime) <$> v .:? "SnapshotInterval") .!= DefaultSnapshotInterval
446+
_ -> pure ov
442447
qsize <-
443448
(fmap RequestedQueryBatchSize <$> o .:? "QueryBatchSize")
444449
.!= DefaultQueryBatchSize

0 commit comments

Comments
 (0)