Skip to content
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/Plugins/MinIO/LoggerMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace Monai.Deploy.Storage.MinIO
{
public static partial class LoggerMethods
{
[LoggerMessage(EventId = 20000, Level = LogLevel.Error, Message = "Error listing objects in bucket '{bucketName}'.")]
public static partial void ListObjectError(this ILogger logger, string bucketName);
[LoggerMessage(EventId = 20000, Level = LogLevel.Error, Message = "Error listing objects in bucket '{bucketName}' with error: {error}")]
public static partial void ListObjectError(this ILogger logger, string bucketName, string error);

[LoggerMessage(EventId = 20001, Level = LogLevel.Error, Message = "File '{path}' could not be found in '{bucketName}'.")]
public static partial void FileNotFoundError(this ILogger logger, string bucketName, string path);
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/MinIO/MinIoStorageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ private async Task<IList<VirtualFileInfo>> ListObjectsUsingClient(MinioClient cl
},
error =>
{
_logger.ListObjectError(bucketName);
_logger.ListObjectError(bucketName, error.Message);
},
() => completedEvent.Set(), cancellationToken);

Expand Down
6 changes: 1 addition & 5 deletions src/Plugins/MinIO/StorageAdminService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,13 @@ private Process CreateProcess(string cmd)
public async Task<bool> HasConnectionAsync()
{
var result = await GetConnectionAsync().ConfigureAwait(false);
return result.Any(r => r.Equals(_serviceName));
return result.Any(r => r.Trim().Equals(_serviceName));
}

public async Task<List<string>> GetConnectionAsync() => await ExecuteAsync(_get_connections_cmd).ConfigureAwait(false);

public async Task<bool> SetConnectionAsync()
{
if (await HasConnectionAsync().ConfigureAwait(false))
{
return true;
}
var result = await ExecuteAsync(_set_connection_cmd).ConfigureAwait(false);
if (result.Any(r => r.Contains($"Added `{_serviceName}` successfully.")))
{
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/IServiceCollectionExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static IServiceCollection AddMonaiDeployStorageService(
this IServiceCollection services,
string fullyQualifiedTypeName,
IFileSystem fileSystem,
HealthCheckOptions healthCheckOptions = HealthCheckOptions.ServiceHealthCheck & HealthCheckOptions.AdminServiceHealthCheck,
HealthCheckOptions healthCheckOptions = HealthCheckOptions.ServiceHealthCheck | HealthCheckOptions.AdminServiceHealthCheck,
HealthStatus? failureStatus = null,
IEnumerable<string>? tags = null,
TimeSpan? timeout = null)
Expand Down