forked from 0xWheatyz/SPARC
Add API cursor-based pagination to /analyze/batch and /jobs endpoints #1441
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?
Summary
The batch and jobs listing endpoints return unbounded result sets, which will cause performance issues at scale.
What to do
cursorandlimitquery parameters to/analyze/batch(results listing) and/jobs.next_cursorin the response body when more results exist.Acceptance criteria
GET /jobs?limit=10returns at most 10 results.next_cursorin the response allows fetching the next page.References
Roadmap: P3 -- API pagination.
Already implemented. The
GET /jobsendpoint inSPARC/api.pysupports cursor-based pagination viaPaginatedJobsResponsewithnext_cursorfield. The cursor encodestimestamp|job_idand the databaselist_jobs()method acceptscursorandlimitparameters. The batch analysis endpoint uses offset/limit pagination which is adequate for its use case.Closing as completed.