summaryrefslogtreecommitdiff
path: root/src/Storage/Internal.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2020-03-05 21:49:07 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2020-03-05 21:49:07 +0100
commit38a22490180c5e98d5ad105938a89ff31f29d349 (patch)
tree0dfda75c0d5dfd2531e76bff723d8567c5a4e49a /src/Storage/Internal.hs
parentaae14ae017dd14beb3fd5a20a1e058ea4327e84d (diff)
Storage: read object files strictly
Avoids problem with exhausting file descriptors when waiting for unfinished lazy reads.
Diffstat (limited to 'src/Storage/Internal.hs')
-rw-r--r--src/Storage/Internal.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Storage/Internal.hs b/src/Storage/Internal.hs
index 76adaab..5f5055a 100644
--- a/src/Storage/Internal.hs
+++ b/src/Storage/Internal.hs
@@ -121,7 +121,7 @@ ioLoadBytesFromStorage st dgst = loadCurrent st >>=
Nothing | Just parent <- stParent st -> ioLoadBytesFromStorage parent dgst
| otherwise -> return Nothing
where loadCurrent Storage { stBacking = StorageDir { dirPath = spath } } = handleJust (guard . isDoesNotExistError) (const $ return Nothing) $
- Just . decompress <$> (BL.readFile $ refPath spath dgst)
+ Just . decompress . BL.fromChunks . (:[]) <$> (B.readFile $ refPath spath dgst)
loadCurrent Storage { stBacking = StorageMemory { memObjs = tobjs } } = M.lookup dgst <$> readMVar tobjs
refPath :: FilePath -> RefDigest -> FilePath