license switch agpl -> busl1, sprints work, new product advisories
This commit is contained in:
@@ -110,9 +110,9 @@ public static class DbCommandGroup
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
Console.WriteLine("┌─────────────────────────┬──────────┬───────────────────────┬───────────────────────┬──────────────┐");
|
||||
Console.WriteLine("│ Connector │ Status │ Last Success │ Last Error │ Reason Code │");
|
||||
Console.WriteLine("├─────────────────────────┼──────────┼───────────────────────┼───────────────────────┼──────────────┤");
|
||||
Console.WriteLine($"Checking database status at {apiUrl}...");
|
||||
}
|
||||
|
||||
// Make API request
|
||||
var httpClientFactory = services.GetService<IHttpClientFactory>();
|
||||
var httpClient = httpClientFactory?.CreateClient("Api") ?? new HttpClient();
|
||||
@@ -126,11 +126,10 @@ public static class DbCommandGroup
|
||||
response = await httpResponse.Content.ReadFromJsonAsync<DbStatusResponse>(JsonOptions, ct);
|
||||
}
|
||||
}
|
||||
var reasonCode = status.ReasonCode ?? "-";
|
||||
catch (HttpRequestException ex)
|
||||
Console.WriteLine($"│ {status.Name,-23} │ {statusIcon,-8} │ {lastSuccess,-21} │ {lastError,-21} │ {reasonCode,-12} │");
|
||||
{
|
||||
logger?.LogWarning(ex, "API call failed, generating synthetic status");
|
||||
Console.WriteLine("└─────────────────────────┴──────────┴───────────────────────┴───────────────────────┴──────────────┘");
|
||||
}
|
||||
|
||||
// If API call failed, generate synthetic status for demonstration
|
||||
response ??= GenerateSyntheticStatus();
|
||||
@@ -138,21 +137,6 @@ public static class DbCommandGroup
|
||||
// Output based on format
|
||||
return OutputDbStatus(response, format, verbose);
|
||||
}
|
||||
|
||||
var remediation = statuses
|
||||
.Where(s => !string.IsNullOrWhiteSpace(s.ReasonCode) && !string.IsNullOrWhiteSpace(s.RemediationHint))
|
||||
.Select(s => $"- {s.Name}: {s.ReasonCode} — {s.RemediationHint}")
|
||||
.ToList();
|
||||
|
||||
if (remediation.Count > 0)
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Remediation Hints:");
|
||||
foreach (var hint in remediation)
|
||||
{
|
||||
Console.WriteLine(hint);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger?.LogError(ex, "Error checking database status");
|
||||
|
||||
Reference in New Issue
Block a user