mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Update DistributedLockService.cs (#8398)
This commit is contained in:
parent
df2bdb3e5c
commit
c62203116f
@ -46,7 +46,7 @@ namespace Orchard.Tasks.Locking.Services {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.Warning("Failed to acquire lock '{0}' within the specified timeout ({1}).", name, timeout);
|
Logger.Debug("Failed to acquire lock '{0}' within the specified timeout ({1}).", name, timeout);
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
Logger.Error(ex, "Error while trying to acquire lock '{0}'.", name);
|
Logger.Error(ex, "Error while trying to acquire lock '{0}'.", name);
|
||||||
@ -112,7 +112,6 @@ namespace Orchard.Tasks.Locking.Services {
|
|||||||
_locks.Add(monitorObj, dLock);
|
_locks.Add(monitorObj, dLock);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -121,7 +120,9 @@ namespace Orchard.Tasks.Locking.Services {
|
|||||||
|
|
||||||
if (throwOnTimeout)
|
if (throwOnTimeout)
|
||||||
throw new TimeoutException(String.Format("Failed to acquire lock '{0}' within the specified timeout ({1}).", internalName, timeout));
|
throw new TimeoutException(String.Format("Failed to acquire lock '{0}' within the specified timeout ({1}).", internalName, timeout));
|
||||||
|
else
|
||||||
|
Monitor.Exit(monitorObj);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user