mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-19 17:51:45 +08:00
Update DistributedLockService.cs (#8398)
This commit is contained in:
@@ -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,6 +120,8 @@ 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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user