继续测试
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))
|
.WithHttpClient(new HttpClient(httpClientHandler))
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
#region 废弃3
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 废弃2
|
||||||
|
|
||||||
var pipe = new System.IO.Pipelines.Pipe();
|
var pipe = new System.IO.Pipelines.Pipe();
|
||||||
|
|
||||||
|
|
@ -553,54 +557,24 @@ public class OSSService : IOSSService
|
||||||
var args = new GetObjectArgs()
|
var args = new GetObjectArgs()
|
||||||
.WithBucket(minIOConfig.BucketName)
|
.WithBucket(minIOConfig.BucketName)
|
||||||
.WithObject(ossRelativePath)
|
.WithObject(ossRelativePath)
|
||||||
.WithCallbackStream(async source =>
|
.WithCallbackStream(stream =>
|
||||||
{
|
{
|
||||||
await source.CopyToAsync(pipe.Writer.AsStream());
|
stream.CopyTo(pipe.Writer.AsStream());
|
||||||
await pipe.Writer.FlushAsync();
|
pipe.Writer.FlushAsync();
|
||||||
});
|
});
|
||||||
|
|
||||||
await minioClient.GetObjectAsync(args);
|
await minioClient.GetObjectAsync(args);
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
await pipe.Writer.CompleteAsync();
|
await pipe.Writer.CompleteAsync();
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Error($"minio 获取流错误:{ex.Message}");
|
||||||
|
await pipe.Writer.CompleteAsync(ex);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return pipe.Reader.AsStream();
|
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
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue