mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-05-20 00:05:25 +00:00
only reconnect client on temporary errors in single subscription too (not currently used) (#616)
* only reconnect client on temporary errors in single subscription too (not currently used) * refactor
This commit is contained in:
committed by
GitHub
parent
14cb88e725
commit
4f4b4f7eee
@@ -611,9 +611,11 @@ subscribeQueue c rq@RcvQueue {connId, server, rcvPrivateKey, rcvId} = do
|
||||
modifyTVar' (subscrConns c) $ S.insert connId
|
||||
RQ.addQueue rq $ pendingSubs c
|
||||
r <- withLogClient c server rcvId "SUB" $ \smp ->
|
||||
liftIO (runExceptT (subscribeSMPQueue smp rcvPrivateKey rcvId) >>= processSubResult c rq)
|
||||
liftIO $ runExceptT (subscribeSMPQueue smp rcvPrivateKey rcvId) >>= processSubResult c rq
|
||||
case r of
|
||||
Left e -> reconnectServer c server >> throwError (protocolClientError SMP (B.unpack $ strEncode server) e)
|
||||
Left e -> do
|
||||
when (temporaryClientError e) $ reconnectServer c server
|
||||
throwError (protocolClientError SMP (B.unpack $ strEncode server) e)
|
||||
_ -> pure ()
|
||||
|
||||
processSubResult :: AgentClient -> RcvQueue -> Either ProtocolClientError () -> IO (Either ProtocolClientError ())
|
||||
|
||||
Reference in New Issue
Block a user