改成内存流测试
continuous-integration/drone/push Build is running
Details
continuous-integration/drone/push Build is running
Details
parent
c8d181e557
commit
5a27fbc127
|
|
@ -535,30 +535,35 @@ public class OSSService : IOSSService
|
||||||
.WithSSL(minIOConfig.UseSSL)
|
.WithSSL(minIOConfig.UseSSL)
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
var pipe = new System.IO.Pipelines.Pipe();
|
#region 废弃3
|
||||||
|
|
||||||
_ = Task.Run(async () =>
|
//var pipe = new System.IO.Pipelines.Pipe();
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var args = new GetObjectArgs()
|
|
||||||
.WithBucket(minIOConfig.BucketName)
|
|
||||||
.WithObject(ossRelativePath)
|
|
||||||
.WithCallbackStream(async source =>
|
|
||||||
{
|
|
||||||
await source.CopyToAsync(pipe.Writer.AsStream());
|
|
||||||
await pipe.Writer.FlushAsync();
|
|
||||||
});
|
|
||||||
|
|
||||||
await minioClient.GetObjectAsync(args);
|
//_ = Task.Run(async () =>
|
||||||
}
|
//{
|
||||||
finally
|
// try
|
||||||
{
|
// {
|
||||||
await pipe.Writer.CompleteAsync();
|
// var args = new GetObjectArgs()
|
||||||
}
|
// .WithBucket(minIOConfig.BucketName)
|
||||||
});
|
// .WithObject(ossRelativePath)
|
||||||
|
// .WithCallbackStream(async source =>
|
||||||
|
// {
|
||||||
|
// await source.CopyToAsync(pipe.Writer.AsStream());
|
||||||
|
// await pipe.Writer.FlushAsync();
|
||||||
|
// });
|
||||||
|
|
||||||
|
// await minioClient.GetObjectAsync(args);
|
||||||
|
// }
|
||||||
|
// finally
|
||||||
|
// {
|
||||||
|
// await pipe.Writer.CompleteAsync();
|
||||||
|
// }
|
||||||
|
//});
|
||||||
|
|
||||||
|
//return pipe.Reader.AsStream();
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
return pipe.Reader.AsStream();
|
|
||||||
|
|
||||||
|
|
||||||
#region 废弃2
|
#region 废弃2
|
||||||
|
|
@ -594,16 +599,16 @@ public class OSSService : IOSSService
|
||||||
|
|
||||||
#region 废弃
|
#region 废弃
|
||||||
|
|
||||||
//var memoryStream = new MemoryStream();
|
var memoryStream = new MemoryStream();
|
||||||
|
|
||||||
//var getObjectArgs = new GetObjectArgs()
|
var getObjectArgs = new GetObjectArgs()
|
||||||
// .WithBucket(minIOConfig.BucketName)
|
.WithBucket(minIOConfig.BucketName)
|
||||||
// .WithObject(ossRelativePath)
|
.WithObject(ossRelativePath)
|
||||||
// .WithCallbackStream(stream => stream.CopyToAsync(memoryStream));
|
.WithCallbackStream(stream => stream.CopyToAsync(memoryStream));
|
||||||
|
|
||||||
//await minioClient.GetObjectAsync(getObjectArgs);
|
await minioClient.GetObjectAsync(getObjectArgs);
|
||||||
//memoryStream.Position = 0;
|
memoryStream.Position = 0;
|
||||||
//return memoryStream;
|
return memoryStream;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue