public async Task FinalizeUploadAsync(IUpload upload, IUploadBlock[] blocks) { int retryCount = 0; Exception lastException; do { if (retryCount > 0) { await Task.Delay(retryPolicy.GetDelay(retryCount)).ConfigureAwait(false); } try { var request = new CompleteMultipartUploadRequest(client.Host, upload, blocks); await client.CompleteMultipartUploadAsync(request).ConfigureAwait(false); return; } catch (S3Exception ex) when(ex.IsTransient) { lastException = ex; } retryCount++; }while (retryPolicy.ShouldRetry(retryCount)); throw lastException; }
public async Task CompleteUploadAsync(IUpload upload, IUploadBlock[] blocks) { var request = new CompleteMultipartUploadRequest(client.Host, upload, blocks); await client.CompleteMultipartUploadAsync(request).ConfigureAwait(false); }
public async Task CompleteUploadAsync(IUpload upload, IUploadBlock[] blocks) { var completeRequest = new CompleteMultipartUploadRequest(client.Region, upload, blocks); var result = await client.CompleteMultipartUploadAsync(completeRequest).ConfigureAwait(false); }