Browse Source

Dispose releaser when not entered

pull/15817/head
Mark Cilia Vincenti 3 years ago
parent
commit
73f85a0718
  1. 1
      framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs

1
framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs

@ -33,6 +33,7 @@ public class LocalAbpDistributedLock : IAbpDistributedLock, ISingletonDependency
var timeoutReleaser = await _localSyncObjects.LockAsync(key, timeout, cancellationToken);
if (!timeoutReleaser.EnteredSemaphore)
{
timeoutReleaser.Dispose();
return null;
}
return new LocalAbpDistributedLockHandle(timeoutReleaser);

Loading…
Cancel
Save