Skip to content
Open
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
6 changes: 5 additions & 1 deletion src/Foundatio.Redis/Queues/RedisQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,10 @@
// IConnectionMultiplexer supports IAsyncDisposable since SE.Redis 2.6.66.
public override void Dispose()
{
base.Dispose();
if (IsDisposed)
return;

SignalDispose();

Check failure on line 815 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

The name 'SignalDispose' does not exist in the current context

Check failure on line 815 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

The name 'SignalDispose' does not exist in the current context

Check failure on line 815 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

The name 'SignalDispose' does not exist in the current context

Check failure on line 815 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

The name 'SignalDispose' does not exist in the current context

Check failure on line 815 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

The name 'SignalDispose' does not exist in the current context

Check failure on line 815 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

The name 'SignalDispose' does not exist in the current context

Check failure on line 815 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

The name 'SignalDispose' does not exist in the current context

Check failure on line 815 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

The name 'SignalDispose' does not exist in the current context
_connectionMultiplexer.ConnectionRestored -= ConnectionMultiplexerOnConnectionRestored;

if (_isSubscribed)
Expand Down Expand Up @@ -853,6 +856,7 @@
}

WaitForMaintenanceTask();
base.Dispose();
_cache.Dispose();
}

Expand Down
6 changes: 6 additions & 0 deletions tests/Foundatio.Redis.Tests/Queues/RedisQueueTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ public override Task DequeueAsync_WithDispose_AutoAbandonsEntryAsync()
return base.DequeueAsync_WithDispose_AutoAbandonsEntryAsync();
}

[Fact]
public override Task Dispose_WithMaintenanceRunning_DoesNotThrowObjectDisposedException()
{
return base.Dispose_WithMaintenanceRunning_DoesNotThrowObjectDisposedException();
}

[Fact]
public override Task DequeueWaitWillGetSignaledAsync()
{
Expand Down
Loading