Skip to content

Commit

Permalink
Allow instance deletion from pending state (#1368)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino authored Sep 26, 2024
1 parent 5414ee4 commit 6944d00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/core/lib/core/services/cloud/workflow/shared.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6944d00

Please sign in to comment.