Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/Foundatio.AzureServiceBus/Queues/AzureServiceBusQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,11 @@ private CreateQueueOptions CreateQueueOptions()

public override void Dispose()
{
base.Dispose();
if (!SignalDispose())
{
_logger.LogTrace("Queue {QueueName} ({QueueId}) dispose was already called", _options.Name, QueueId);
return;
}

if (_queueSender is not null)
{
Expand All @@ -640,11 +644,17 @@ public override void Dispose()
{
_client.Value.DisposeAsync().AsTask().GetAwaiter().GetResult();
}

base.Dispose();
}

public async ValueTask DisposeAsync()
{
base.Dispose();
if (!SignalDispose())
{
_logger.LogTrace("Queue {QueueName} ({QueueId}) async dispose was already called", _options.Name, QueueId);
return;
}

if (_queueSender is not null)
{
Expand All @@ -662,6 +672,8 @@ public async ValueTask DisposeAsync()
{
await _client.Value.DisposeAsync().AnyContext();
}

base.Dispose();
}

private async Task DeadLetterMessageAsync(AzureServiceBusQueueEntry<T> entry)
Expand Down
2 changes: 1 addition & 1 deletion tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<NoWarn>$(NoWarn);CS1591;NU1701</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.6.0" />
<PackageReference Include="xunit.v3.mtp-v2" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.4" PrivateAssets="All" />
Expand Down
Loading