diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2020-03-05 21:49:07 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2020-03-05 21:49:07 +0100 |
commit | 38a22490180c5e98d5ad105938a89ff31f29d349 (patch) | |
tree | 0dfda75c0d5dfd2531e76bff723d8567c5a4e49a /src | |
parent | aae14ae017dd14beb3fd5a20a1e058ea4327e84d (diff) |
Storage: read object files strictly
Avoids problem with exhausting file descriptors when waiting for
unfinished lazy reads.
Diffstat (limited to 'src')
-rw-r--r-- | src/Storage/Internal.hs | 2 |
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 |