Forum Discussion
Eline_SharePointFAB
Oct 12, 2023Copper Contributor
Error 429 when processing large documentlibrary
I'm trying to clean up all document versions above 100 on all documentlibraries in client's tenant.
The smaller ones are fine and are cleaning up like a charm. But the bigger ones give problems.
Is it possible to load the documents in a library in intervals of for example 5000 documents at a time, so that chance of throttling can be minimized?
I have attached a photo of the script. The parameters are above (Site/document libraries/versions to keep)
1 Reply
Sort By
- LainRobertsonSilver Contributor
With respect to the HTTP 429 topic within your question, there is no simple answer since an answer will vary depending on the number of licences involved.
As a result, where you're asking if you can load 5,000 documents at a time, we can't say, since the answer will depend on your licencing volume. And beyond whether or not you can load 5,000 in a single request, you then have to factor in how many are you permitted to load within a one minute interval.
You should read about the way throttling works to begin with:
Going one step further, you need to be aware of the limitations in relation to throttling of the community-written PnP module:
If you were to write your own REST-based implementation, you could leverage the "Retry-After" header data, but you cannot do this using the PnP module.
Cheers,
Lain