From 6d7309cc9c1ed7873a9d20ae3a4da1be04879f48 Mon Sep 17 00:00:00 2001 From: benbierens Date: Mon, 11 Dec 2023 08:51:46 +0100 Subject: [PATCH] Update bot for deployment without codex nodes. --- Tools/BiblioTech/Commands/AdminCommand.cs | 8 +++++--- Tools/BiblioTech/DeploymentsFilesMonitor.cs | 3 --- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Tools/BiblioTech/Commands/AdminCommand.cs b/Tools/BiblioTech/Commands/AdminCommand.cs index 62c38328..5e4d4784 100644 --- a/Tools/BiblioTech/Commands/AdminCommand.cs +++ b/Tools/BiblioTech/Commands/AdminCommand.cs @@ -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 { diff --git a/Tools/BiblioTech/DeploymentsFilesMonitor.cs b/Tools/BiblioTech/DeploymentsFilesMonitor.cs index 00920340..6713d79a 100644 --- a/Tools/BiblioTech/DeploymentsFilesMonitor.cs +++ b/Tools/BiblioTech/DeploymentsFilesMonitor.cs @@ -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;