mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-05-15 09:35:24 +00:00
ntf: flush ntfSubQ on deleting all subscriptions (#442)
This commit is contained in:
@@ -65,7 +65,7 @@ module Simplex.Messaging.Agent
|
||||
)
|
||||
where
|
||||
|
||||
import Control.Concurrent.STM (stateTVar)
|
||||
import Control.Concurrent.STM (flushTBQueue, stateTVar)
|
||||
import Control.Logger.Simple (logInfo, showText)
|
||||
import Control.Monad.Except
|
||||
import Control.Monad.IO.Unlift (MonadUnliftIO)
|
||||
@@ -792,6 +792,7 @@ initializeNtfSubs c = do
|
||||
smpDeleteNtfSubs :: AgentMonad m => AgentClient -> m ()
|
||||
smpDeleteNtfSubs c = do
|
||||
ns <- asks ntfSupervisor
|
||||
void . atomically . flushTBQueue $ ntfSubQ ns
|
||||
connIds <- atomically $ getSubscriptions c
|
||||
forM_ connIds $ \connId -> atomically $ writeTBQueue (ntfSubQ ns) (connId, NSCSmpDelete)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user