Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
fix: last page sometimes returning empty by fetching one more key
Browse files Browse the repository at this point in the history
  • Loading branch information
ytkimirti committed May 15, 2024
1 parent 7ca62ed commit 0f7c270
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ class PaginatedRedis {
}

async getPage(page: number) {
this.targetCount = (page + 1) * PAGE_SIZE;
// +1 here to fetch one more than needed to check if there is a next page
this.targetCount = (page + 1) * PAGE_SIZE + 1;

if (!this.isFetching) {
try {
Expand Down

0 comments on commit 0f7c270

Please sign in to comment.