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
1 change: 1 addition & 0 deletions src/Plugins/AWSS3/StorageAdminService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ public class StorageAdminService : IStorageAdminService
public Task<bool> HasConnectionAsync() => throw new NotImplementedException();

public Task RemoveUserAsync(string username) => throw new NotImplementedException();
public Task<bool> SetConnectionAsync() => throw new NotImplementedException();
}
}
9 changes: 7 additions & 2 deletions src/Plugins/MinIO/MinIoAdminHealthCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ public MinIoAdminHealthCheck(IStorageAdminService storageAdminService, ILogger<M
{
try
{
var hasConnection = await _storageAdminService.HasConnectionAsync();
var connectionResult = await _storageAdminService.GetConnectionAsync();
var hasConnection = await _storageAdminService.HasConnectionAsync().ConfigureAwait(false);
if (hasConnection is false)
{
await _storageAdminService.SetConnectionAsync().ConfigureAwait(false);
}

var connectionResult = await _storageAdminService.GetConnectionAsync().ConfigureAwait(false);
var joinedResult = string.Join("\n", connectionResult);

var roDict = new ReadOnlyDictionary<string, object>(new Dictionary<string, object>() { { "MinoAdminResult", joinedResult } });
Expand Down
6 changes: 6 additions & 0 deletions src/Storage/API/IStorageAdminService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,11 @@ public interface IStorageAdminService
/// </summary>
/// <returns></returns>
Task<bool> HasConnectionAsync();

/// <summary>
/// Cread the Admin alias.
/// </summary>
/// <returns>Bool</returns>
Task<bool> SetConnectionAsync();
}
}