Refactoring locking strategy

Adding support for tenants
Removed ThreadId field
Removed Count field
Optimized db access by using Monitor for the local machine/tenant checks
Removed Machine/Thread scopes
This commit is contained in:
Sebastien Ros
2015-09-02 18:37:38 -07:00
parent d0ad5de25c
commit 9ea87837c3
21 changed files with 300 additions and 379 deletions

View File

@@ -6,7 +6,7 @@ namespace Orchard.TaskLease.Services {
/// Describes a service to save and acquire task leases. A task lease can't be acquired by two different machines,
/// for a specific amount of time. Optionnally a State can be saved along with the lease.
/// </summary>
[Obsolete("Use Orchard.Tasks.Locking.IDistributedLockService and the AcquireLockForMachine/TryAcquireLockForMachine methods instead.")]
[Obsolete("Use Orchard.Tasks.Locking.IDistributedLockService instead.")]
public interface ITaskLeaseService : IDependency {
/// <summary>

View File

@@ -9,7 +9,7 @@ namespace Orchard.TaskLease.Services {
/// <summary>
/// Provides a database driven implementation of <see cref="ITaskLeaseService" />
/// </summary>
[Obsolete("Use Orchard.Tasks.Locking.DistributedLockService and the AcquireLockForMachine/TryAcquireLockForMachine methods instead.")]
[Obsolete("Use Orchard.Tasks.Locking.DistributedLockService instead.")]
public class TaskLeaseService : ITaskLeaseService {
private readonly IRepository<TaskLeaseRecord> _repository;