File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1443,10 +1443,10 @@ subscribeAllConnections' c onlyNeeded activeUserId_ = handleErr $ do
14431443 tryAllErrors' $ do
14441444 qs <- withStore' c $ \ db -> do
14451445 qs <- getUserServerRcvQueueSubs db userId srv onlyNeeded
1446- atomically $ modifyTVar' currPending (+ length qs) -- update before leaving transaction
1446+ unless ( null qs) $ atomically $ modifyTVar' currPending (+ length qs) -- update before leaving transaction
14471447 pure qs
14481448 let n = length qs
1449- lift $ subscribe qs `E.finally` atomically (modifyTVar' currPending $ subtract n)
1449+ unless ( null qs) $ lift $ subscribe qs `E.finally` atomically (modifyTVar' currPending $ subtract n)
14501450 pure n
14511451 where
14521452 subscribe qs = do
You can’t perform that action at this time.
0 commit comments