From e62314a802e770f14d0ba47d41daa831af8d9644 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Mon, 16 Dec 2024 22:32:01 +0000 Subject: [PATCH] add TODOs --- src/Simplex/Messaging/Server.hs | 2 ++ src/Simplex/Messaging/Server/MsgStore/Journal.hs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/Simplex/Messaging/Server.hs b/src/Simplex/Messaging/Server.hs index a2759ba8f..65c561af0 100644 --- a/src/Simplex/Messaging/Server.hs +++ b/src/Simplex/Messaging/Server.hs @@ -384,6 +384,8 @@ smpServer started cfg@ServerConfig {transports, transportConfig = tCfg} attachHT threadDelay' interval old <- expireBeforeEpoch expCfg now <- systemSeconds <$> getSystemTime + -- TODO [queues] this should iterate all queues, there are more queues than active queues in journal mode + -- TODO [queues] it should also compact journals (see 2024-11-25-journal-expiration.md) msgStats@MessageStats {storedMsgsCount = stored, expiredMsgsCount = expired} <- withActiveMsgQueues ms $ expireQueueMsgs now ms old atomicWriteIORef (msgCount stats) stored diff --git a/src/Simplex/Messaging/Server/MsgStore/Journal.hs b/src/Simplex/Messaging/Server/MsgStore/Journal.hs index 87be761e8..96d04faf9 100644 --- a/src/Simplex/Messaging/Server/MsgStore/Journal.hs +++ b/src/Simplex/Messaging/Server/MsgStore/Journal.hs @@ -894,6 +894,7 @@ removeJournal dir JournalState {journalId} = do -- This function is supposed to be resilient to crashes while updating state files, -- and also resilient to crashes during its execution. +-- TODO [queues] remove old timed backups readWriteQueueState :: JournalMsgStore s -> FilePath -> IO (MsgQueueState, Handle) readWriteQueueState JournalMsgStore {random, config} statePath = ifM