Skip to content

Commit

Permalink
Remove unused monitoring task variable
Browse files Browse the repository at this point in the history
  • Loading branch information
highlyunavailable committed Feb 25, 2016
1 parent 9d56247 commit 97501a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Consul/Lock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ public class Lock : IDistributedLock

private CancellationTokenSource _cts;
private Task _sessionRenewTask;
private Task _monitorTask;

private readonly ConsulClient _client;
internal LockOptions Opts { get; set; }
Expand Down Expand Up @@ -291,7 +290,7 @@ public CancellationToken Acquire(CancellationToken ct)
return _cts.Token;
}
IsHeld = true;
_monitorTask = MonitorLock();
MonitorLock();
return _cts.Token;
}

Expand All @@ -311,7 +310,7 @@ public CancellationToken Acquire(CancellationToken ct)
if (locked)
{
IsHeld = true;
_monitorTask = MonitorLock();
MonitorLock();
return _cts.Token;
}

Expand Down
3 changes: 1 addition & 2 deletions Consul/Semaphore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ internal SemaphoreLock()

private readonly ConsulClient _client;
private Task _sessionRenewTask;
private Task _monitorTask;
internal SemaphoreOptions Opts { get; set; }

public bool IsHeld
Expand Down Expand Up @@ -404,7 +403,7 @@ public CancellationToken Acquire(CancellationToken ct)
}

IsHeld = true;
_monitorTask = MonitorLock(LockSession);
MonitorLock(LockSession);
return _cts.Token;
}
throw new SemaphoreNotHeldException("Unable to acquire the semaphore with Consul");
Expand Down

0 comments on commit 97501a5

Please sign in to comment.