mirror of
https://github.com/bitwarden/server.git
synced 2026-01-31 14:13:18 +08:00
Add configurable queue name support to AzureQueueHostedService (#6718)
This commit is contained in:
@@ -57,14 +57,16 @@ public class AzureQueueHostedService : IHostedService, IDisposable
|
|||||||
private async Task ExecuteAsync(CancellationToken cancellationToken)
|
private async Task ExecuteAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var storageConnectionString = _configuration["azureStorageConnectionString"];
|
var storageConnectionString = _configuration["azureStorageConnectionString"];
|
||||||
if (string.IsNullOrWhiteSpace(storageConnectionString))
|
var queueName = _configuration["azureQueueServiceQueueName"];
|
||||||
|
if (string.IsNullOrWhiteSpace(storageConnectionString) ||
|
||||||
|
string.IsNullOrWhiteSpace(queueName))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var repo = new Core.Repositories.TableStorage.EventRepository(storageConnectionString);
|
var repo = new Core.Repositories.TableStorage.EventRepository(storageConnectionString);
|
||||||
_eventWriteService = new RepositoryEventWriteService(repo);
|
_eventWriteService = new RepositoryEventWriteService(repo);
|
||||||
_queueClient = new QueueClient(storageConnectionString, "event");
|
_queueClient = new QueueClient(storageConnectionString, queueName);
|
||||||
|
|
||||||
while (!cancellationToken.IsCancellationRequested)
|
while (!cancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user