From 6d4d3a34a0058e57906671eba9c92b15dc412cc2 Mon Sep 17 00:00:00 2001 From: Jamil Date: Sun, 1 Jun 2025 18:00:30 -0700 Subject: [PATCH] fix(portal): Uniq nodes before counting (#9352) While we shouldn't have any duplicates in this list, it would be a good idea to unique the node names before counting just to be sure. --- .../lib/domain/cluster/google_compute_labels_strategy.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elixir/apps/domain/lib/domain/cluster/google_compute_labels_strategy.ex b/elixir/apps/domain/lib/domain/cluster/google_compute_labels_strategy.ex index cc33cb04b..e6972bdbe 100644 --- a/elixir/apps/domain/lib/domain/cluster/google_compute_labels_strategy.ex +++ b/elixir/apps/domain/lib/domain/cluster/google_compute_labels_strategy.ex @@ -187,7 +187,9 @@ defmodule Domain.Cluster.GoogleComputeLabelsStrategy do end defp connected_node_count(nodes, target_app) do - Enum.count(nodes, fn node_name -> + nodes + |> Enum.uniq() + |> Enum.count(fn node_name -> app = node_name |> Atom.to_string()