From e3559f151274efab80e3a97d99bd6e35238fa6ce Mon Sep 17 00:00:00 2001 From: Noon van der Silk Date: Thu, 21 Nov 2024 15:44:55 +0000 Subject: [PATCH] Unsafe persistence as well --- hydra-node/src/Hydra/Persistence.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hydra-node/src/Hydra/Persistence.hs b/hydra-node/src/Hydra/Persistence.hs index ad89ce7e4d9..6fac32b1ef2 100644 --- a/hydra-node/src/Hydra/Persistence.hs +++ b/hydra-node/src/Hydra/Persistence.hs @@ -12,7 +12,7 @@ import Data.ByteString qualified as BS import Data.ByteString.Char8 qualified as C8 import System.Directory (createDirectoryIfMissing, doesFileExist) import System.FilePath (takeDirectory) -import UnliftIO.IO.File (withBinaryFile, writeBinaryFileDurableAtomic) +import UnliftIO.IO.File (withBinaryFile, writeBinaryFile) data PersistenceException = PersistenceException String @@ -37,7 +37,8 @@ createPersistence fp = do pure $ Persistence { save = \a -> do - writeBinaryFileDurableAtomic fp . toStrict $ Aeson.encode a + -- FIXME: this is not atomic / durable + writeBinaryFile fp . toStrict $ Aeson.encode a , load = liftIO (doesFileExist fp) >>= \case False -> pure Nothing