mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-08-28 18:08:18 +00:00
agent: stop statistics and cleanup when chat is stopped (#1251)
This commit is contained in:
@@ -235,6 +235,7 @@ logServersStats c = do
|
||||
liftIO $ threadDelay' delay
|
||||
int <- asks (logStatsInterval . config)
|
||||
forever $ do
|
||||
atomically $ waitUntilActive c
|
||||
saveServersStats c
|
||||
liftIO $ threadDelay' int
|
||||
|
||||
@@ -2112,6 +2113,7 @@ cleanupManager c@AgentClient {subQ} = do
|
||||
int <- asks (cleanupInterval . config)
|
||||
ttl <- asks $ storedMsgDataTTL . config
|
||||
forever $ do
|
||||
atomically $ waitUntilActive c
|
||||
run ERR deleteConns
|
||||
run ERR $ withStore' c (`deleteRcvMsgHashesExpired` ttl)
|
||||
run ERR $ withStore' c (`deleteSndMsgsExpired` ttl)
|
||||
|
||||
Reference in New Issue
Block a user