mirror of
https://github.com/input-output-hk/foliage.git
synced 2024-11-29 14:33:39 +03:00
foliage: Force FileInfo
Unfortunately hackage-security constructs these using lazy bytestrings and they are therefore liable to hold open fds longer than necessary, resulting in fd exhaustion. Fixes another manifestation of #35.
This commit is contained in:
parent
a938062863
commit
1cc2db12ac
@ -32,10 +32,14 @@ readJSONSimple fp = do
|
||||
p <- makeAbsolute (fromFilePath fp)
|
||||
readJSON_NoKeys_NoLayout p
|
||||
|
||||
forceFileInfo :: FileInfo -> ()
|
||||
forceFileInfo (FileInfo a b) = a `seq` b `seq` ()
|
||||
|
||||
computeFileInfoSimple :: FilePath -> IO FileInfo
|
||||
computeFileInfoSimple fp = do
|
||||
p <- makeAbsolute (fromFilePath fp)
|
||||
computeFileInfo p
|
||||
fi <- computeFileInfo p
|
||||
return $! forceFileInfo fi `seq` fi
|
||||
|
||||
createKeys :: FilePath -> IO ()
|
||||
createKeys base = do
|
||||
|
Loading…
Reference in New Issue
Block a user