|
|
|
|
@ -185,13 +185,9 @@ notificationThread clientIdentity callbacks ctx ep idCounter cmdVar killMv secPa
@@ -185,13 +185,9 @@ notificationThread clientIdentity callbacks ctx ep idCounter cmdVar killMv secPa
|
|
|
|
|
[_, payload] -> case decode (BL.fromStrict payload) of |
|
|
|
|
Just notification -> do |
|
|
|
|
currentSqnum <- readIORef notifSqnumRef |
|
|
|
|
if getNotificationSqnum notification /= currentSqnum |
|
|
|
|
then |
|
|
|
|
if currentSqnum > getNotificationSqnum notification |
|
|
|
|
then log Debug "Broker.Client" $ "Already processed notification: " <> (T.pack . show) (getNotificationSqnum notification) |
|
|
|
|
else log Warning "Broker.Client" $ |
|
|
|
|
when (getNotificationSqnum notification /= currentSqnum) $ do |
|
|
|
|
log Warning "Broker.Client" $ |
|
|
|
|
"Notification sqnum mismatch: " <> (T.pack . show) currentSqnum <> " -> " <> (T.pack . show) (getNotificationSqnum notification) |
|
|
|
|
else do |
|
|
|
|
atomicWriteIORef notifSqnumRef (nextSqnum currentSqnum) |
|
|
|
|
forM_ callbacks $ \c -> c notification |
|
|
|
|
atomicWriteIORef lastKnownNotificationSqnum currentSqnum |
|
|
|
|
|