mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-05-17 07:50:01 +00:00
rx_service: ensure fetch msgs query is performed when missing msg
This commit is contained in:
parent
75864a705e
commit
2c92dd2745
@ -113,15 +113,19 @@ proc checkStore*(self: RecvService) {.async.} =
|
|||||||
let missedHashes: seq[WakuMessageHash] =
|
let missedHashes: seq[WakuMessageHash] =
|
||||||
msgHashesInStore.filterIt(not rxMsgHashes.contains(it))
|
msgHashesInStore.filterIt(not rxMsgHashes.contains(it))
|
||||||
|
|
||||||
## Now retrieve the missing WakuMessages and deliver them
|
if missedHashes.len > 0:
|
||||||
let missingMsgsRet = await self.getMissingMsgsFromStore(missedHashes)
|
info "missed messages detected, checking store for missed messages",
|
||||||
if missingMsgsRet.isOk():
|
pubsubTopic = pubsubTopic, missedCount = missedHashes.len
|
||||||
for msgTuple in missingMsgsRet.get():
|
|
||||||
if self.processIncomingMessageOfInterest(msgTuple.pubsubTopic, msgTuple.msg):
|
## Now retrieve the missing WakuMessages and deliver them
|
||||||
info "recv service store-recovered message",
|
let missingMsgsRet = await self.getMissingMsgsFromStore(missedHashes)
|
||||||
msg_hash = shortLog(msgTuple.hash), pubsubTopic = msgTuple.pubsubTopic
|
if missingMsgsRet.isOk():
|
||||||
else:
|
for msgTuple in missingMsgsRet.get():
|
||||||
error "failed to retrieve missing messages: ", error = $missingMsgsRet.error
|
if self.processIncomingMessageOfInterest(msgTuple.pubsubTopic, msgTuple.msg):
|
||||||
|
info "recv service store-recovered message",
|
||||||
|
msg_hash = shortLog(msgTuple.hash), pubsubTopic = msgTuple.pubsubTopic
|
||||||
|
else:
|
||||||
|
error "failed to retrieve missing messages: ", error = $missingMsgsRet.error
|
||||||
|
|
||||||
## update next check times
|
## update next check times
|
||||||
self.startTimeToCheck = self.endTimeToCheck
|
self.startTimeToCheck = self.endTimeToCheck
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user