Skip to content

Commit 8aba03e

Browse files
committed
misc
1 parent 3c2ce00 commit 8aba03e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Extensions/BackgroundQueueExtension.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Threading;
33
using System.Threading.Tasks;
44
using Microsoft.Extensions.DependencyInjection;
5+
using Soenneker.Extensions.Task;
56
using Soenneker.Utils.BackgroundQueue.Abstract;
67

78
namespace Soenneker.Utils.BackgroundQueue.Extensions;
@@ -59,7 +60,7 @@ public static void StopBackgroundQueueSync(this IServiceProvider services, Cance
5960
if (queuedHostedService == null)
6061
return;
6162

62-
queuedHostedService.StopAsync(cancellationToken);
63+
queuedHostedService.StopAsync(cancellationToken).NoSync().GetAwaiter().GetResult();
6364
queuedHostedService.Dispose();
6465
}
6566

@@ -70,7 +71,7 @@ public static async ValueTask StopBackgroundQueue(this IServiceProvider services
7071
if (queuedHostedService == null)
7172
return;
7273

73-
await queuedHostedService.StopAsync(cancellationToken);
74+
await queuedHostedService.StopAsync(cancellationToken).NoSync();
7475
queuedHostedService.Dispose();
7576
}
7677
}

0 commit comments

Comments
 (0)