Browse Source

BrokerClient: ignore packets with mismatched request id

master
Denis Tereshkin 11 months ago
parent
commit
b05bc4fe32
  1. 4
      src/ATrade/Broker/Client.hs

4
src/ATrade/Broker/Client.hs

@ -157,9 +157,7 @@ brokerClientThread socketIdentity ep cmd comp killMv notificationCallbacks logge @@ -157,9 +157,7 @@ brokerClientThread socketIdentity ep cmd comp killMv notificationCallbacks logge
(req, respVar, _) <- takeMVar respVar
if getRequestId req == getResponseRequestId resp
then putMVar respVar resp
else do
log Warning "Broker.Client" $ TL.toStrict $ [t|Request ID mismatch: %?/%?|] (getRequestId req) (getResponseRequestId resp)
putMVar respVar (ResponseError (getRequestId req) "Request ID mismatch")
else log Warning "Broker.Client" $ TL.toStrict $ [t|Request ID mismatch: %?/%?|] (getRequestId req) (getResponseRequestId resp)
handleMessage _ (IncomingNotification notif) = callNotificationCallbacks notif
callNotificationCallbacks notif = mapM_ (\cb -> cb notif) notificationCallbacks

Loading…
Cancel
Save