Skip to content

Commit

Permalink
Read snapshot interval from main toplevel config too
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Jan 30, 2025
1 parent 1d5598d commit 5c8fc00
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cardano-node/src/Cardano/Node/Configuration/POM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,14 @@ instance FromJSON PartialNodeConfiguration where
(fmap RequestedNumOfDiskSnapshots <$> o .:? "NumOfDiskSnapshots")
.!= DefaultNumOfDiskSnapshots
doChecksum <- (fmap Flag <$> o .:? "DoDiskSnapshotChecksum") .!= DoDiskSnapshotChecksum
snapInterval <-
(fmap (RequestedSnapshotInterval . secondsToDiffTime) <$> o .:? "SnapshotInterval")
.!= DefaultSnapshotInterval
snapInterval <- do
ov <- (fmap (RequestedSnapshotInterval . secondsToDiffTime) <$> o .:? "SnapshotInterval") .!= DefaultSnapshotInterval
case ov of
DefaultSnapshotInterval -> do
-- 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
-- It is needed for the pre-emptive cluster runs
(fmap (RequestedSnapshotInterval . secondsToDiffTime) <$> v .:? "SnapshotInterval") .!= DefaultSnapshotInterval
_ -> pure ov
qsize <-
(fmap RequestedQueryBatchSize <$> o .:? "QueryBatchSize")
.!= DefaultQueryBatchSize
Expand Down

0 comments on commit 5c8fc00

Please sign in to comment.