mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-12-21 22:05:47 +08:00
perf: ⚡ 引入 Microsoft.VisualStudio.Threading.Analyzers 分析器 (#62)
This commit is contained in:
@@ -39,12 +39,12 @@ public static class CaptchaImageHelper
|
||||
await using var tranStream = resAsm.GetManifestResourceStream($"{tempPath}._{templateIndex}.transparent.png");
|
||||
|
||||
// 底图
|
||||
using var backgroundImage = await Image.LoadAsync<Rgba32>(bgStream);
|
||||
using var backgroundImage = await Image.LoadAsync<Rgba32>(bgStream).ConfigureAwait(false);
|
||||
|
||||
using var darkTemplateImage = await Image.LoadAsync<Rgba32>(darkStream);
|
||||
using var darkTemplateImage = await Image.LoadAsync<Rgba32>(darkStream).ConfigureAwait(false);
|
||||
|
||||
// 透明模板图
|
||||
using var transparentTemplateImage = await Image.LoadAsync<Rgba32>(tranStream);
|
||||
using var transparentTemplateImage = await Image.LoadAsync<Rgba32>(tranStream).ConfigureAwait(false);
|
||||
|
||||
// 调整模板图大小
|
||||
darkTemplateImage.Mutate(x => x.Resize(sliderSize));
|
||||
|
||||
@@ -26,9 +26,9 @@ public sealed class MinioHelper(IOptions<UploadOptions> uploadOptions) : IScoped
|
||||
|
||||
var beArgs = new BucketExistsArgs().WithBucket(uploadOptions.Value.Minio.BucketName);
|
||||
|
||||
if (!await minio.BucketExistsAsync(beArgs)) {
|
||||
if (!await minio.BucketExistsAsync(beArgs).ConfigureAwait(false)) {
|
||||
var mbArgs = new MakeBucketArgs().WithBucket(uploadOptions.Value.Minio.BucketName);
|
||||
await minio.MakeBucketAsync(mbArgs);
|
||||
await minio.MakeBucketAsync(mbArgs).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
var putArgs = new PutObjectArgs().WithBucket(uploadOptions.Value.Minio.BucketName)
|
||||
@@ -36,7 +36,7 @@ public sealed class MinioHelper(IOptions<UploadOptions> uploadOptions) : IScoped
|
||||
.WithStreamData(fileStream)
|
||||
.WithObjectSize(fileSize)
|
||||
.WithContentType(contentType);
|
||||
_ = await minio.PutObjectAsync(putArgs);
|
||||
_ = await minio.PutObjectAsync(putArgs).ConfigureAwait(false);
|
||||
|
||||
return $"{uploadOptions.Value.Minio.AccessUrl}/{uploadOptions.Value.Minio.BucketName}/{objectName}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user