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