Skip to content

Commit 99e0015

Browse files
StephenMolloyAl Baymar
andauthored
Allow pre-provisioned throughput (#68)
* Allowing to use provisioned throughput by setting offerThroughput value to "0". * Round-about way of re-writing this onto current main, but I wanted to keep the original PR commit in the list for credit. --------- Co-authored-by: Al Baymar <[email protected]>
1 parent 37f4c13 commit 99e0015

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/CosmosDBSessionStateProviderAsync.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Then, register your new provider like so:
2222

2323
2. *cosmosDBAuthKeySettingKey* - The appsetting key name which points to a CosmosDB auth key
2424

25-
3. *offerThroughput* - The offer throughput provisioned for a collection in measurement of Requests-per-Unit in the Azure DocumentDB database service. If the collection provided doesn't exist, the provider will create a collection with this offerThroughput.
25+
3. *offerThroughput* - The offer throughput provisioned for a collection in measurement of Requests-per-Unit in the Azure DocumentDB database service. If the collection provided doesn't exist, the provider will create a collection with this offerThroughput. If set to "0", collection will be set to use the default throughput of the database.
2626

2727
4. *connectionMode* - Direct | Gateway
2828

src/CosmosDBSessionStateProviderAsync/CosmosDBSessionStateProviderAsync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ private static async Task CreateContainerIfNotExistsAsync()
887887
IndexingPolicy = s_indexNone
888888
};
889889

890-
ContainerResponse response = await database.CreateContainerIfNotExistsAsync(containerProperties, s_offerThroughput).ConfigureAwait(false);
890+
ContainerResponse response = await database.CreateContainerIfNotExistsAsync(containerProperties, s_offerThroughput > 0 ? s_offerThroughput : (int?)null).ConfigureAwait(false);
891891

892892
if (response?.Resource?.PartitionKeyPath != partitionKeyPath)
893893
{

0 commit comments

Comments
 (0)