Why are you using GetAwaiter().GetResult() in all of your code instead of just making the functions async?
In case you don't know, in C#, you should always aim to work with async/await when you have Tasks. If you are using ".GetAwaiter ().GetResult ()", ".Result" or ".Wait ()" to get the result of a task or to wait for the task completion you may experience deadlocks or thread pool starvation.
You use them everywhere. This is not how the Cosmos DB should be used.
|
Task.WhenAll(_tasks).GetAwaiter().GetResult(); |
Why are you using GetAwaiter().GetResult() in all of your code instead of just making the functions async?
In case you don't know, in C#, you should always aim to work with async/await when you have Tasks. If you are using ".GetAwaiter ().GetResult ()", ".Result" or ".Wait ()" to get the result of a task or to wait for the task completion you may experience deadlocks or thread pool starvation.
You use them everywhere. This is not how the Cosmos DB should be used.
Azure-Dev/AZ-204 - Develop for Azure Storage - Azure Cosmos DB/4. Lab - Azure Cosmos DB - .Net - Bulk insert/Bulk Insert/CosmosDB/CosmosDB/Program.cs
Line 34 in 4d747bb