Browse Source

Fixed code to work exactly as the original.

pull/15817/head
Mark Cilia Vincenti 4 years ago
parent
commit
445da6a4c7
  1. 10
      framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs

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

@ -28,11 +28,11 @@ public class LocalAbpDistributedLock : IAbpDistributedLock, ISingletonDependency
Check.NotNullOrWhiteSpace(name, nameof(name)); Check.NotNullOrWhiteSpace(name, nameof(name));
var key = DistributedLockKeyNormalizer.NormalizeKey(name); var key = DistributedLockKeyNormalizer.NormalizeKey(name);
if (timeout == default) //if (timeout == default)
{ //{
var releaser = await _localSyncObjects.LockAsync(key, cancellationToken); // var releaser = await _localSyncObjects.LockAsync(key, cancellationToken);
return new LocalAbpDistributedLockHandle(releaser); // return new LocalAbpDistributedLockHandle(releaser);
} //}
var timeoutReleaser = await _localSyncObjects.LockAsync(key, timeout, cancellationToken); var timeoutReleaser = await _localSyncObjects.LockAsync(key, timeout, cancellationToken);
if (!timeoutReleaser.EnteredSemaphore) if (!timeoutReleaser.EnteredSemaphore)

Loading…
Cancel
Save