-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
It is well known that one should never call Task.Result, Task.Wait(), or Task.WaitAll() in normal code due to the possibility of deadlocks. I see a couple of places where you are calling the Task.Result property. You should rewrite those places like this: someTask.ConfigureAwait(false).GetAwaiter().GetResult(). This is the idiomatic way to run a task when inside a method that is not asynchronous.
There is also no need to call Task.Run unless you intend to either await the call or to fire-and-forget. If you need the result and you're inside a synchronous method, you should write the code as I've done above.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels