继续测试
continuous-integration/drone/push Build is running
Details
continuous-integration/drone/push Build is running
Details
parent
96776b0b3d
commit
775704c509
|
|
@ -542,7 +542,11 @@ public class OSSService : IOSSService
|
|||
.WithHttpClient(new HttpClient(httpClientHandler))
|
||||
.Build();
|
||||
|
||||
#region 废弃3
|
||||
|
||||
|
||||
|
||||
|
||||
#region 废弃2
|
||||
|
||||
var pipe = new System.IO.Pipelines.Pipe();
|
||||
|
||||
|
|
@ -553,54 +557,24 @@ public class OSSService : IOSSService
|
|||
var args = new GetObjectArgs()
|
||||
.WithBucket(minIOConfig.BucketName)
|
||||
.WithObject(ossRelativePath)
|
||||
.WithCallbackStream(async source =>
|
||||
.WithCallbackStream(stream =>
|
||||
{
|
||||
await source.CopyToAsync(pipe.Writer.AsStream());
|
||||
await pipe.Writer.FlushAsync();
|
||||
stream.CopyTo(pipe.Writer.AsStream());
|
||||
pipe.Writer.FlushAsync();
|
||||
});
|
||||
|
||||
await minioClient.GetObjectAsync(args);
|
||||
}
|
||||
finally
|
||||
{
|
||||
await pipe.Writer.CompleteAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error($"minio 获取流错误:{ex.Message}");
|
||||
await pipe.Writer.CompleteAsync(ex);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return pipe.Reader.AsStream();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 废弃2
|
||||
|
||||
//var pipe = new System.IO.Pipelines.Pipe();
|
||||
|
||||
//_ = Task.Run(async () =>
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var args = new GetObjectArgs()
|
||||
// .WithBucket(minIOConfig.BucketName)
|
||||
// .WithObject(ossRelativePath)
|
||||
// .WithCallbackStream(stream =>
|
||||
// {
|
||||
// stream.CopyTo(pipe.Writer.AsStream());
|
||||
// });
|
||||
|
||||
// await minioClient.GetObjectAsync(args);
|
||||
// await pipe.Writer.CompleteAsync();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Log.Error($"minio 获取流错误:{ex.Message}");
|
||||
// await pipe.Writer.CompleteAsync(ex);
|
||||
// }
|
||||
//});
|
||||
|
||||
|
||||
//return pipe.Reader.AsStream();
|
||||
#endregion
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue