forked from 0xWheatyz/SPARC
Add cursor-based pagination to /analyze/batch and /jobs endpoints #223
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
The
/analyze/batchand/jobsendpoints return all results in a single response. As the dataset grows this will cause slow responses and high memory use.Roadmap reference: ROADMAP.md > P3 > API pagination
What to do
created_at+idas the cursor) on both endpoints.limitandcursorquery parameters; return anext_cursorin the response envelope.Acceptance criteria
GET /jobs?limit=20returns at most 20 items and anext_cursor.GET /jobs?limit=20&cursor=<token>returns the next page.next_cursor.This issue has already been resolved in the current codebase.
The
GET /jobsendpoint inapi.pysupports cursor-based pagination withcursorandlimitquery parameters. The response includes anext_cursorfield for fetching the next page. Thedatabase.pylist_jobs()method supports cursor-based queries.Closing as already implemented.