Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replaced MinioClient to IMinioClient in HealthChecks #73

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Minio.AspNetCore.HealthChecks/MinioHealthCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
{
public class MinioHealthCheck : IHealthCheck
{
private readonly MinioClient minioClient;
private readonly IMinioClient minioClient;
private readonly string bucket;

public MinioHealthCheck(MinioClient minioClient, string bucket)
public MinioHealthCheck(IMinioClient minioClient, string bucket)
{
this.minioClient = minioClient;
this.bucket = bucket;
Expand All @@ -25,7 +25,7 @@

return HealthCheckResult.Healthy();
}
catch (Exception exception)

Check warning on line 28 in src/Minio.AspNetCore.HealthChecks/MinioHealthCheck.cs

View workflow job for this annotation

GitHub Actions / Tests

Modify 'CheckHealthAsync' to catch a more specific allowed exception type, or rethrow the exception (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1031)

Check warning on line 28 in src/Minio.AspNetCore.HealthChecks/MinioHealthCheck.cs

View workflow job for this annotation

GitHub Actions / Tests

Modify 'CheckHealthAsync' to catch a more specific allowed exception type, or rethrow the exception (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1031)

Check warning on line 28 in src/Minio.AspNetCore.HealthChecks/MinioHealthCheck.cs

View workflow job for this annotation

GitHub Actions / Tests

Modify 'CheckHealthAsync' to catch a more specific allowed exception type, or rethrow the exception (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1031)
{
return HealthCheckResult.Unhealthy(exception: exception);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
/// </summary>
public static IHealthChecksBuilder AddMinio(
this IHealthChecksBuilder builder,
Func<IServiceProvider, MinioClient> factory,
Func<IServiceProvider, IMinioClient> factory,
string name = "minio",
string bucket = "health",
HealthStatus? failureStatus = null,
IEnumerable<string>? tags = null,
TimeSpan? timeout = null)
{
if (builder is null)

Check warning on line 22 in src/Minio.AspNetCore.HealthChecks/MinioHealthChecksExtensions.cs

View workflow job for this annotation

GitHub Actions / Tests

Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1510)

Check warning on line 22 in src/Minio.AspNetCore.HealthChecks/MinioHealthChecksExtensions.cs

View workflow job for this annotation

GitHub Actions / Tests

Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1510)
{
throw new ArgumentNullException(nameof(builder));
}
Expand Down
Loading