Skip to content

Commit

Permalink
remove else
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabh1007 committed Jul 3, 2024
1 parent 1d04618 commit 10d3911
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions Microsoft.Azure.Cosmos/src/Telemetry/VmMetadataApiHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,24 @@ internal static void TryInitialize(CosmosHttpClient httpClient)
{
return;
}
else

if (VmMetadataApiHandler.isInitialized)
{
return;
}

lock (VmMetadataApiHandler.lockObject)
{
if (VmMetadataApiHandler.isInitialized)
{
return;
}

lock (VmMetadataApiHandler.lockObject)
{
if (VmMetadataApiHandler.isInitialized)
{
return;
}
DefaultTrace.TraceInformation("Initializing VM Metadata API ");

DefaultTrace.TraceInformation("Initializing VM Metadata API ");
VmMetadataApiHandler.isInitialized = true;

VmMetadataApiHandler.isInitialized = true;

_ = Task.Run(() => MetadataApiCallAsync(httpClient), default);
}
_ = Task.Run(() => MetadataApiCallAsync(httpClient), default);
}
}

Expand Down

0 comments on commit 10d3911

Please sign in to comment.