示例#1
0
        private Task PutChunkAsync(OperationContext context, DedupNode dedupNode, AbsolutePath path)
        {
            var dedupIdentifier = dedupNode.GetDedupId();

            return(TryGatedArtifactOperationAsync(
                       context,
                       dedupIdentifier.ValueString,
                       "PutChunkAndKeepUntilReferenceAsync",
                       innerCts => DedupStoreClient.Client.PutChunkAndKeepUntilReferenceAsync(
                           dedupIdentifier.CastToChunkDedupIdentifier(),
                           DedupCompressedBuffer.FromUncompressed(File.ReadAllBytes(path.Path)),
                           new KeepUntilBlobReference(EndDateTime),
                           innerCts)));
        }
示例#2
0
        private async Task PutNodeAsync(OperationContext context, DedupNode dedupNode, AbsolutePath path)
        {
            var dedupIdentifier = dedupNode.GetDedupId();

            await TryGatedArtifactOperationAsync <object>(
                context,
                dedupIdentifier.ValueString,
                "DedupUploadSession.UploadAsync",
                async innerCts =>
            {
                await _uploadSession.UploadAsync(dedupNode, new Dictionary <VstsDedupIdentifier, string> {
                    { dedupIdentifier, path.Path }
                }, innerCts);
                return(null);
            });
        }