File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
cardano-testnet/src/Testnet Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 55{-# LANGUAGE FlexibleInstances #-}
66{-# LANGUAGE GADTs #-}
77{-# LANGUAGE LambdaCase #-}
8+ {-# LANGUAGE NumericUnderscores #-}
89{-# LANGUAGE OverloadedStrings #-}
910{-# LANGUAGE ScopedTypeVariables #-}
1011
@@ -43,7 +44,7 @@ import GHC.Stack
4344import qualified GHC.Stack as GHC
4445import Network.Socket (HostAddress , PortNumber )
4546import Prettyprinter (unAnnotate )
46- import RIO (runRIO )
47+ import RIO (runRIO , threadDelay )
4748import qualified System.Directory as IO
4849import System.FilePath
4950import qualified System.IO as IO
@@ -252,7 +253,16 @@ startNode tp node ipv4 port _testnetMagic nodeCmd = GHC.withFrozenCallStack $ do
252253createDirectoryIfMissingNew :: HasCallStack => FilePath -> IO FilePath
253254createDirectoryIfMissingNew directory = GHC. withFrozenCallStack $ do
254255 IO. createDirectoryIfMissing True directory
255- pure directory
256+ exists <- IO. doesDirectoryExist directory
257+ if exists
258+ then pure directory
259+ else do
260+ threadDelay 5_000_000
261+ IO. createDirectoryIfMissing True directory
262+ exists' <- IO. doesDirectoryExist directory
263+ if exists'
264+ then pure directory
265+ else throwString $ " Failed to create directory: " <> directory
256266
257267
258268createSubdirectoryIfMissingNew :: ()
You can’t perform that action at this time.
0 commit comments