forked from 0xWheatyz/SPARC
Add cursor-based pagination to /analyze/batch and /jobs endpoints #1418
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Roadmap item: P3 -- API pagination
As the number of jobs and patent records grows, returning all results in a single response becomes impractical. Pagination is needed for scalability.
What to do
GET /jobsandGET /analyze/batch.limitandcursor(orpage/offset) query parameters.next_cursor(ornext_page) field in the response envelope.Acceptance criteria
GET /jobs?limit=20returns at most 20 results and a cursor for the next page.Triage: Already resolved in main.
Cursor-based pagination is implemented for the
/jobsendpoint inSPARC/api.py(around line 1047):limitandcursorquery parametersnext_cursorfield inPaginatedJobsResponse(line 94-98)timestamp|job_idfor stable orderinglimitcontinue to worklist_jobs()with cursor parameterClosing as complete.