Remove lock from the dictionary when the task has completed. (#8395)

Fixes #8391
This commit is contained in:
Imran Azad
2020-06-18 18:19:44 +01:00
committed by GitHub
parent 2bc7079593
commit df2bdb3e5c

View File

@@ -104,6 +104,7 @@ namespace Orchard.Tasks.Locking.Services {
Logger.Debug("Record for lock '{0}' already owned by current machine or was successfully created; creating lock object.", internalName);
dLock = new DistributedLock(name, internalName, releaseLockAction: () => {
_locks.Remove(monitorObj);
Monitor.Exit(monitorObj);
DeleteDistributedLockRecord(internalName);
});