示例#1
0
        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;
        }
示例#2
0
        public async Task CompleteUploadAsync(IUpload upload, IUploadBlock[] blocks)
        {
            var request = new CompleteMultipartUploadRequest(client.Host, upload, blocks);

            await client.CompleteMultipartUploadAsync(request).ConfigureAwait(false);
        }
示例#3
0
        public async Task CompleteUploadAsync(IUpload upload, IUploadBlock[] blocks)
        {
            var completeRequest = new CompleteMultipartUploadRequest(client.Region, upload, blocks);

            var result = await client.CompleteMultipartUploadAsync(completeRequest).ConfigureAwait(false);
        }