Fix CleanupService

Fixes that the lock handle wasn't actually used
This commit is contained in:
Sipke Schoorstra 2021-11-04 11:40:28 +01:00
parent 369ebb6db3
commit 844ada9a67

View file

@ -38,7 +38,10 @@ namespace Elsa.Retention.HostedServices
{
await Task.Delay(_interval, stoppingToken);
await using var handle = await _distributedLockProvider.AcquireLockAsync(nameof(CleanupService), cancellationToken: stoppingToken);
if (handle == null)
continue;
try
{
await job.ExecuteAsync(stoppingToken);