Skip to content

Commit cb93af1

Browse files
ChangeFeedProcessor: Removes redundant parameter from GetLeasePartitionKeyValue
Method now reads IsChangeFeedLeaseIdAsPartitionKeyEnabled directly since it is a static field on the same class. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 239a381 commit cb93af1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/LeaseManagement/DocumentServiceLeaseManagerCosmos.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public override Task<DocumentServiceLease> CreateLeaseIfNotExistAsync(
132132

133133
this.requestOptionsFactory.AddPartitionKeyIfNeeded(
134134
(string pk) => documentServiceLease.LeasePartitionKey = pk,
135-
GetLeasePartitionKeyValue(IsChangeFeedLeaseIdAsPartitionKeyEnabled, documentServiceLease.LeaseId));
135+
DocumentServiceLeaseManagerCosmos.GetLeasePartitionKeyValue(documentServiceLease.LeaseId));
136136

137137
return this.TryCreateDocumentServiceLeaseAsync(documentServiceLease);
138138
}
@@ -159,14 +159,14 @@ public override Task<DocumentServiceLease> CreateLeaseIfNotExistAsync(
159159

160160
this.requestOptionsFactory.AddPartitionKeyIfNeeded(
161161
(string pk) => documentServiceLease.LeasePartitionKey = pk,
162-
GetLeasePartitionKeyValue(IsChangeFeedLeaseIdAsPartitionKeyEnabled, documentServiceLease.LeaseId));
162+
DocumentServiceLeaseManagerCosmos.GetLeasePartitionKeyValue(documentServiceLease.LeaseId));
163163

164164
return this.TryCreateDocumentServiceLeaseAsync(documentServiceLease);
165165
}
166166

167-
private static string GetLeasePartitionKeyValue(bool isLeaseIdAsPartitionKeyEnabled, string leaseId)
167+
private static string GetLeasePartitionKeyValue(string leaseId)
168168
{
169-
return isLeaseIdAsPartitionKeyEnabled
169+
return DocumentServiceLeaseManagerCosmos.IsChangeFeedLeaseIdAsPartitionKeyEnabled
170170
? leaseId
171171
: Guid.NewGuid().ToString();
172172
}

0 commit comments

Comments
 (0)