add Connection wholesale

This commit is contained in:
Alexander Bondarenko
2024-04-26 18:43:49 +03:00
parent 0622a52e00
commit 33c36c8101
2 changed files with 4 additions and 9 deletions
+3 -5
View File
@@ -2181,7 +2181,7 @@ processChatCommand' vr = \case
Nothing -> "idle"
Just Nothing -> "waiting"
Just (Just _async) -> "working"
conn@Connection {connStatus, createdAt} <-
connection <-
withStore (\db -> getConnectionEntity db vr user acId) >>= \case
RcvDirectMsgConnection {entityConnection} -> pure entityConnection
RcvGroupMsgConnection {entityConnection} -> pure entityConnection
@@ -2201,9 +2201,7 @@ processChatCommand' vr = \case
smpClientStatus,
subWorkerStatus,
queueStatus = tshow rqStatus,
connStatus_ = connStatus,
connAuthErrors = (authErrCounter conn, connDisabled conn),
createdAt = createdAt
connection
}
DebugLocks -> lift $ do
chatLockName <- atomically . tryReadTMVar =<< asks chatLock
@@ -7576,4 +7574,4 @@ dummyFileDescr = FileDescr {fileDescrText = "", fileDescrPartNo = 0, fileDescrCo
agentDeliveryStatus :: AgentConnId -> (AgentDeliveryStatus -> AgentDeliveryStatus) -> CM' ()
agentDeliveryStatus acId f = do
ads <- asks agentDeliveryStatuses
atomically $ TM.lookup acId ads >>= mapM_ (`modifyTVar'`f)
atomically $ TM.lookup acId ads >>= mapM_ (`modifyTVar'` f)
+1 -4
View File
@@ -786,10 +786,7 @@ data DebugConnectionStatus = DebugConnectionStatus
server :: (Text, String), -- what's the server for this connection? -- XXX: reveals private servers and association
smpClientStatus :: Text, -- is there an active client for it?
subWorkerStatus :: Text, -- a session was recently restarted and tries to resubscribe
-- from Connection
connStatus_ :: ConnStatus, -- does the protocol permits delivery
connAuthErrors :: (Int, Bool), -- number of AUTH errors before connection gets disabled
createdAt :: UTCTime
connection :: Connection
}
deriving (Show)