Update bot for deployment without codex nodes.

This commit is contained in:
benbierens 2023-12-11 08:51:46 +01:00
parent ec03be6936
commit 6d7309cc9c
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
2 changed files with 5 additions and 6 deletions

View File

@ -136,9 +136,6 @@ namespace BiblioTech.Commands
protected override async Task onSubCommand(CommandContext context)
{
var deployments = Program.DeploymentFilesMonitor.GetDeployments();
//todo shows old deployments
if (!deployments.Any())
{
await context.Followup("No deployments available.");
@ -269,6 +266,11 @@ namespace BiblioTech.Commands
await context.Followup("No deployment found.");
return default;
}
if (deployment.CodexInstances == null || !deployment.CodexInstances.Any())
{
await context.Followup("No codex instances were deployed.");
return default;
}
try
{

View File

@ -62,9 +62,6 @@ namespace BiblioTech
private bool IsDeploymentOk(CodexDeployment? deploy)
{
if (deploy == null) return false;
if (deploy.CodexInstances == null) return false;
if (!deploy.CodexInstances.Any()) return false;
if (!deploy.CodexInstances.All(i => i.Containers != null && i.Info != null)) return false;
if (deploy.GethDeployment == null) return false;
if (deploy.GethDeployment.Containers == null) return false;
return true;