Forum Discussion

Christophe Humbert's avatar
Christophe Humbert
Iron Contributor
Mar 29, 2021

429 throttling even though I wait for each request to complete

 

I am using the Graph API in SPFx (MSGraphClient).

 

I need to add events to a user calendar (usually between 10 and 20 for the month). Unfortunately, https://docs.microsoft.com/en-us/graph/throttling#outlook-service-limits (!).

 

To try and prevent concurrent events, I am executing the requests one at a time, with an await expression:

              for (let i = 0i < locks.lengthi++) {
                let lock = locks[i];
                await props.context.msGraphClientFactory.getClient()
                  .then((clientMSGraphClient😞 void => {
                    client
                      .api("/me/events")
                      .post({
                        "subject":...
 
This doesn't work, I am still getting 429 throttling message even though the requests are not concurrent. What am I missing here, and what would be the proper way to handle the situation?

Resources