diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-12-31 20:20:23 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-12-31 20:20:23 +0100 |
commit | 7ad3fb235dde2e0be8adc0feeb890da438c70eff (patch) | |
tree | 38d0b6a44692dc4e4d146558097a15077c89e46a /src/Erebos/Storage/Internal.hs | |
parent | 6cc15c6cd859070fda1b46995108fbfc3e13a5db (diff) |
Use evaluate to force digest before storing to backend
Diffstat (limited to 'src/Erebos/Storage/Internal.hs')
-rw-r--r-- | src/Erebos/Storage/Internal.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Erebos/Storage/Internal.hs b/src/Erebos/Storage/Internal.hs index 59d0af0..6df1410 100644 --- a/src/Erebos/Storage/Internal.hs +++ b/src/Erebos/Storage/Internal.hs @@ -3,6 +3,7 @@ module Erebos.Storage.Internal where import Control.Arrow import Control.Concurrent import Control.DeepSeq +import Control.Exception import Control.Monad import Control.Monad.Identity @@ -270,7 +271,7 @@ instance StorageCompleteness Partial where unsafeStoreRawBytes :: Storage' c -> BL.ByteString -> IO (Ref' c) unsafeStoreRawBytes st@Storage {..} raw = do - let dgst = hashToRefDigest raw + dgst <- evaluate $ force $ hashToRefDigest raw backendStoreBytes stBackend dgst raw return $ Ref st dgst |