fix: prevent empty store response due to blocked walker (#897)

This commit is contained in:
Hanno Cornelius 2022-03-17 17:18:59 +02:00 committed by GitHub
parent 2d6a2bec47
commit 266d6a7e80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -200,6 +200,7 @@ proc fwdPage(storeQueue: StoreQueueRef,
outSeq = @[]
outPagingInfo = PagingInfo(pageSize: 0, cursor: startCursor.get(), direction: PagingDirection.FORWARD)
outError = HistoryResponseError.INVALID_CURSOR
w.destroy
return (outSeq, outPagingInfo, outError)
# Advance walker once more
@ -271,6 +272,7 @@ proc bwdPage(storeQueue: StoreQueueRef,
outSeq = @[]
outPagingInfo = PagingInfo(pageSize: 0, cursor: startCursor.get(), direction: PagingDirection.BACKWARD)
outError = HistoryResponseError.INVALID_CURSOR
w.destroy
return (outSeq, outPagingInfo, outError)
# Step walker one more step back