Update DistributedLockService.cs (#8398)

This commit is contained in:
Imran Azad
2020-07-09 18:09:35 +01:00
committed by GitHub
parent df2bdb3e5c
commit c62203116f

View File

@@ -46,7 +46,7 @@ namespace Orchard.Tasks.Locking.Services {
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) {
Logger.Error(ex, "Error while trying to acquire lock '{0}'.", name);
@@ -112,7 +112,6 @@ namespace Orchard.Tasks.Locking.Services {
_locks.Add(monitorObj, dLock);
return true;
}
return false;
});
@@ -121,7 +120,9 @@ namespace Orchard.Tasks.Locking.Services {
if (throwOnTimeout)
throw new TimeoutException(String.Format("Failed to acquire lock '{0}' within the specified timeout ({1}).", internalName, timeout));
else
Monitor.Exit(monitorObj);
return null;
}
}