smp server: optionally append store log with postgres storage (without loading and compacting, for debugging during migration) (#1480)

* smp server: optionally maintain store log with postgres storage (without loading and compacting, for debugging during migration)

* refactor

* remove comment
This commit is contained in:
Evgeny authored and GitHub committed 2025-03-13 10:25:56 +00:00
1 parent d44f09d111
commit 019a32a623
10 files changed
+151 -100

No files matched your search

+4 -4
View File
@@ -158,9 +158,9 @@ instance StrEncoding StoreLogRecord where
DeleteNotifier_ -> DeleteNotifier <$> strP
UpdateTime_ -> UpdateTime <$> strP_ <*> strP
openWriteStoreLog :: FilePath -> IO (StoreLog 'WriteMode)
openWriteStoreLog f = do
h <- openFile f WriteMode
openWriteStoreLog :: Bool -> FilePath -> IO (StoreLog 'WriteMode)
openWriteStoreLog append f = do
h <- openFile f $ if append then AppendMode else WriteMode
hSetBuffering h LineBuffering
pure $ WriteStoreLog f h
@@ -239,7 +239,7 @@ readWriteStoreLog readStore writeStore f st =
removeStoreLogBackups f
pure s
writeLog msg = do
s <- openWriteStoreLog f
s <- openWriteStoreLog False f
logInfo msg
writeStore s st
pure s