简体   繁体   English

在Microsoft.Graph SDK中将TimeOut设置为更高的值

[英]Set TimeOut to a higher value in Microsoft.Graph SDK

I get timeout error frequently with the below code using the Microsoft.Graph package, 我使用Microsoft.Graph包使用下面的代码经常出现超时错误,

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. 由于没有选项(我可以找到)一次添加多个联系人,我正在调用上面的LOC并行。 I have around say 500 contacts to import and many of them fails giving the timeout response 我有大约500个要导入的联系人,其中很多都没有给出超时响应

Exception: Code: timeout Message: The request timed out. 例外:代码:超时消息:请求超时。

Are there any option to set TimeOut to a higher value in Microsoft.Graph GraphServiceClient? 有没有选项可以在Microsoft.Graph GraphServiceClient中将TimeOut设置为更高的值?

您可以将Timeout设置为更高的值,如下所示:例如,将Timeout设置为一小时:

graphServiceClient.HttpProvider.OverallTimeout = TimeSpan.FromHours(1);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM