Skip to content

Commit

Permalink
WIP bugfix: handle absence of gsm/
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrisby committed Jan 17, 2024
1 parent 2630870 commit ff123a1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ import qualified Ouroboros.Consensus.HardFork.History.Qry as Qry
import Ouroboros.Consensus.Storage.ChainDB.API (ChainDB)
import qualified Ouroboros.Consensus.Util.NormalForm.StrictTVar as StrictSTM
import Ouroboros.Consensus.Util.Time (nominalDiffTimeToMicroseconds)
import System.FS.API (HasFS, doesFileExist, removeFile, withFile)
import System.FS.API (HasFS, createDirectoryIfMissing, doesFileExist,
removeFile, withFile)
import System.FS.API.Types (AllowExisting (..), FsPath, OpenMode (..),
mkFsPath)

Expand Down Expand Up @@ -316,6 +317,7 @@ realMarkerFileView !_cdb hasFS =
removeMarkerFile = removeFile hasFS markerFile
,
touchMarkerFile = do
createDirectoryIfMissing hasFS True (mkFsPath [])
alreadyExists <- hasMarkerFile
unless alreadyExists $
withFile hasFS markerFile (WriteMode MustBeNew) $ \_h ->
Expand Down

0 comments on commit ff123a1

Please sign in to comment.