|
|
|
|
@ -278,6 +278,7 @@ bcGetNotifications clientIdentity idCounter notifSqnumRef cmdVar lastKnownNotifi
@@ -278,6 +278,7 @@ bcGetNotifications clientIdentity idCounter notifSqnumRef cmdVar lastKnownNotifi
|
|
|
|
|
sqnum <- nextId idCounter |
|
|
|
|
notifSqnum <- nextSqnum <$> readIORef notifSqnumRef |
|
|
|
|
now <- getCurrentTime |
|
|
|
|
result <- timeout 3000000 $ do |
|
|
|
|
putMVar cmdVar (RequestNotifications (RequestId sqnum) clientIdentity notifSqnum, respVar, now) |
|
|
|
|
resp <- takeMVar respVar |
|
|
|
|
case resp of |
|
|
|
|
@ -293,3 +294,6 @@ bcGetNotifications clientIdentity idCounter notifSqnumRef cmdVar lastKnownNotifi
@@ -293,3 +294,6 @@ bcGetNotifications clientIdentity idCounter notifSqnumRef cmdVar lastKnownNotifi
|
|
|
|
|
return $ Left "requestId mismatch" |
|
|
|
|
(ResponseError (RequestId requestId) msg) -> return $ Left msg |
|
|
|
|
_ -> return $ Left "Unknown error" |
|
|
|
|
case result of |
|
|
|
|
Just r -> pure $ r |
|
|
|
|
_ -> pure $ Left "Request timeout" |
|
|
|
|
|