mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Non-functional change but more explicit.
Perhaps a bit subjective, but passing in a null value or a zero value controls whether the AcquireLockInternal will block or not, so probably better to provide an explicit Zero value from TryAcquireLock instead.
This commit is contained in:
@@ -72,7 +72,7 @@ namespace Orchard.Tasks.Locking.Services {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private bool TryAcquireLock(string name, TimeSpan maxValidFor, TimeSpan? timeout, string machineName, int? threadId, out DistributedLock @lock) {
|
private bool TryAcquireLock(string name, TimeSpan maxValidFor, TimeSpan? timeout, string machineName, int? threadId, out DistributedLock @lock) {
|
||||||
@lock = AcquireLockInternal(name, maxValidFor, machineName, threadId, timeout.GetValueOrDefault());
|
@lock = AcquireLockInternal(name, maxValidFor, machineName, threadId, timeout ?? TimeSpan.Zero);
|
||||||
if (@lock != null)
|
if (@lock != null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user