From 6944d00a2a5cc31f3b9dd0dfd4421e45cd8f9972 Mon Sep 17 00:00:00 2001 From: michaeljguarino Date: Thu, 26 Sep 2024 08:46:32 -0400 Subject: [PATCH] Allow instance deletion from pending state (#1368) --- apps/core/lib/core/services/cloud/workflow/shared.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/core/lib/core/services/cloud/workflow/shared.ex b/apps/core/lib/core/services/cloud/workflow/shared.ex index 51741b4b0..1be796b43 100644 --- a/apps/core/lib/core/services/cloud/workflow/shared.ex +++ b/apps/core/lib/core/services/cloud/workflow/shared.ex @@ -104,7 +104,7 @@ defmodule Core.Services.Cloud.Workflow.Shared do def down(inst), do: {:ok, inst} - def finalize(%ConsoleInstance{status: :database_deleted, cluster: cluster, postgres: pg} = inst, :down) do + def finalize(%ConsoleInstance{status: s, cluster: cluster, postgres: pg} = inst, :down) when s in ~w(database_deleted pending)a do start_transaction() |> add_operation(:inst, fn _ -> Repo.delete(inst) end) |> add_operation(:cluster, fn _ -> Cloud.dec(cluster) end)