Hangfire.AzureCosmosDb
Hangfire.AzureCosmosDb copied to clipboard
Add possibility to set Throughputs
In the current implementation there's no way to pass the Throughput Properties to set it.
example :
- Current implementation :
private async Task InitializeAsync(CancellationToken cancellationToken = default)
{
// create database
logger.Info($"Creating database : [{databaseName}]");
DatabaseResponse databaseResponse = await Client.CreateDatabaseIfNotExistsAsync(databaseName, cancellationToken: cancellationToken);
- Desired implementation :
private async Task InitializeAsync(ThroughputProperties throughputProperties = null, CancellationToken cancellationToken = default)
{
// create database
logger.Info($"Creating database : [{databaseName}]");
DatabaseResponse databaseResponse = await Client.CreateDatabaseIfNotExistsAsync(databaseName, throughputProperties, cancellationToken: cancellationToken);
Also it would be better to have two parameters of ThroughputProperties , one for the database and one for the container, maybe a class which contains two properties, example :
public class CosmosThroughputProperties
{
public ThroughputProperties DatabaseThroughputProperties { get; set; }
public ThroughputProperties ContainerThroughputProperties { get; set; }
}
Thanks,