Hi,
I have two services which each of the has the ability to update the same Graph.
One of them is longer than the other. Sometimes they might try to run together.
My code for connecting is the same -
public void Connect()
{
if (!_client.IsConnected)
{
_client.ConnectAsync().Wait();
}
}
Issue is, when the longer service is working, it's connected, and the second one gets stuck on the wait, even when the long one finishes.
I assumed the 'wait' should do the trick. I thought about adding a validation before getting the lock, with some sort of sleep and a recursive call when graph is locked, but found no API for it.
What's the solution in this case? I'd appreciate some guidance. Thanks!