Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set TimeOut to a higher value in Microsoft.Graph SDK

I get timeout error frequently with the below code using the Microsoft.Graph package,

await graphServiceClient.Users[UserId].Contacts.Request().AddAsync(contact);

As there are no option (that I could find) for adding multiple contacts at a time, I was calling the above LOC parallel. I have around say 500 contacts to import and many of them fails giving the timeout response

Exception: Code: timeout Message: The request timed out.

Are there any option to set TimeOut to a higher value in Microsoft.Graph GraphServiceClient?

like image 365
rkeeth Avatar asked Apr 06 '17 16:04

rkeeth


1 Answers

You can set the Timeout to a higher value like this: For example to set the Timeout to one hour:

graphServiceClient.HttpProvider.OverallTimeout = TimeSpan.FromHours(1);
like image 113
Jeremy Avatar answered Nov 08 '22 09:11

Jeremy