فهرست منبع

Revert "Abort paging when there zero results or zero page elements"

This was precisely the wrong thing to do on account of API endpoints
incapable of returning an accurate count of total results.
Jonathan D. Storm 1 روز پیش
والد
کامیت
44f80f4264
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      v6/depager.go

+ 3 - 3
v6/depager.go

@@ -121,9 +121,9 @@ func (p *pager[T]) iteratePages() <-chan Page[T] {
 			if p.cnt == 0 {
 				p.cnt = page.Count()
 			}
-			// We abort when there are zero results or zero
-			// elements in the page.
-			if p.cnt == 0 || len(page.Elems()) == 0 {
+			// When page.Count() is zero, we must rely on the
+			// absence of returned results to know when to stop.
+			if p.cnt == 0 && len(page.Elems()) == 0 {
 				p.pagePool <- page
 				return
 			}