Closed stuartf closed 8 years ago
I've been meaning to add support for pagination for a while but haven't gotten around to it.
Currently, we're just setting { per_page: n }
to a number higher than we'd ever expect to hit.
Are you running into throttling on a local or cloud installation of canvas?
It's a cloud installation.
Here's what I'm doing for autopaging: https://github.com/stuartf/canvas-lms-api/tree/autopaging
it just needs to check the X-Request-Cost
and X-Rate-Limit-Remaining
headers and use bluebird's .delay(ms)
so it doesn't just blow through the requests.
Would you please set up a PR for review/merging?
yeah, I'll send a PR once I get the throttling code in
I've attached a PR to this issue.
Can you please remove me from this repo? On Jan 19, 2016 2:34 PM, "D. Stuart Freeman" notifications@github.com wrote:
I've attached a PR to this issue.
— Reply to this email directly or view it on GitHub https://github.com/beardon/canvas-lms-api/pull/5#issuecomment-172994150.
Landed in 3ab9a118e765300dc30853d307e3b875d4643eca and c31d3d5a9dbd3fc115e7f10519af2a6c23676bfe with minor style changes.
Thanks!
Canvas pages result sets (larger than 10 by default): https://canvas.instructure.com/doc/api/file.pagination.html
Am I missing something, or does this library not support paged responses?
I have a branch in progress that will detect the Link header and recursively request more pages until it has them all, but it's currently running into Canvas' throttling: https://canvas.instructure.com/doc/api/file.throttling.html