From dbaef5a0f8521b3abf792e429f6ca232c74c94ab Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Mon, 25 Mar 2024 16:26:40 +0000 Subject: [PATCH] fix SMP server msgCount stat (#1069) --- src/Simplex/Messaging/Server.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Simplex/Messaging/Server.hs b/src/Simplex/Messaging/Server.hs index 0dcde0350..01977ea56 100644 --- a/src/Simplex/Messaging/Server.hs +++ b/src/Simplex/Messaging/Server.hs @@ -768,7 +768,7 @@ client clnt@Client {subscriptions, ntfSubscriptions, rcvQ, sndQ, sessionId} Serv Message {msgFlags} -> do stats <- asks serverStats atomically $ modifyTVar' (msgRecv stats) (+ 1) - atomically $ modifyTVar' (msgCount stats) (+ 1) + atomically $ modifyTVar' (msgCount stats) (subtract 1) atomically $ updatePeriodStats (activeQueues stats) queueId when (notification msgFlags) $ do atomically $ modifyTVar' (msgRecvNtf stats) (+ 1) @@ -796,7 +796,7 @@ client clnt@Client {subscriptions, ntfSubscriptions, rcvQ, sndQ, sessionId} Serv atomically $ modifyTVar' (msgSentNtf stats) (+ 1) atomically $ updatePeriodStats (activeQueuesNtf stats) (recipientId qr) atomically $ modifyTVar' (msgSent stats) (+ 1) - atomically $ modifyTVar' (msgCount stats) (subtract 1) + atomically $ modifyTVar' (msgCount stats) (+ 1) atomically $ updatePeriodStats (activeQueues stats) (recipientId qr) pure ok where