Skip to content

Commit

Permalink
Fix address logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Willey committed Mar 15, 2022
1 parent 2f2b687 commit 6f28f2f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,15 @@ public async Task<PartitionAddressInformation> TryGetAddressesAsync(
{
addresses = await this.serverPartitionAddressCache.GetAsync(
key: partitionKeyRangeIdentity,
singleValueInitFunc: (staleAddresses) => this.GetAddressesForRangeIdAsync(
request,
partitionKeyRangeIdentity.CollectionRid,
partitionKeyRangeIdentity.PartitionKeyRangeId,
forceRefresh: forceRefreshPartitionAddresses),
singleValueInitFunc: (currentCachedValue) =>
{
staleAddressInfo = currentCachedValue;
return this.GetAddressesForRangeIdAsync(
request,
partitionKeyRangeIdentity.CollectionRid,
partitionKeyRangeIdentity.PartitionKeyRangeId,
forceRefresh: forceRefreshPartitionAddresses);
},
forceRefresh: (_) => true);

if (staleAddressInfo != null)
Expand Down

0 comments on commit 6f28f2f

Please sign in to comment.