继续测试
continuous-integration/drone/push Build is running Details

Test_HIR_Net8
hang 2026-06-05 15:41:48 +08:00
parent 96776b0b3d
commit 775704c509
1 changed files with 14 additions and 40 deletions

View File

@ -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