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 <abaymar@aras.com>
This commit is contained in:
Steve Molloy 2023-01-27 17:21:42 -08:00 коммит произвёл GitHub
Родитель 37f4c1338a
Коммит 99e0015a7e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -22,7 +22,7 @@ Then, register your new provider like so:
2. *cosmosDBAuthKeySettingKey* - The appsetting key name which points to a CosmosDB auth key
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.
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.
4. *connectionMode* - Direct | Gateway

Просмотреть файл

@ -887,7 +887,7 @@ namespace Microsoft.AspNet.SessionState
IndexingPolicy = s_indexNone
};
ContainerResponse response = await database.CreateContainerIfNotExistsAsync(containerProperties, s_offerThroughput).ConfigureAwait(false);
ContainerResponse response = await database.CreateContainerIfNotExistsAsync(containerProperties, s_offerThroughput > 0 ? s_offerThroughput : (int?)null).ConfigureAwait(false);
if (response?.Resource?.PartitionKeyPath != partitionKeyPath)
{