public AcquireLeaseAsync ( |
||
token | ||
return | Task |
private async Task <string> TryAcquireLeaseOrWait(BlobLeaseManager leaseManager, CancellationToken token) { try { var leaseId = await leaseManager.AcquireLeaseAsync(token); if (!string.IsNullOrEmpty(leaseId)) { return(leaseId); } await Task.Delay(AcquireAttemptInterval, token); return(null); } catch (OperationCanceledException) { return(null); } }
private async Task<string> TryAcquireLeaseOrWait(BlobLeaseManager leaseManager, CancellationToken token) { try { var leaseId = await leaseManager.AcquireLeaseAsync(token); if (!string.IsNullOrEmpty(leaseId)) { return leaseId; } await Task.Delay(AcquireAttemptInterval, token); return null; } catch (OperationCanceledException) { return null; } }