Skip to content

Commit

Permalink
RepairWorker code_change
Browse files Browse the repository at this point in the history
  • Loading branch information
bchamagne committed Feb 16, 2024
1 parent 0a55925 commit 5cdcb71
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/archethic/self_repair/repair_worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Archethic.SelfRepair.RepairWorker do
alias Archethic.SelfRepair.NotifierSupervisor

use GenServer, restart: :transient
@vsn 1
@vsn 2

require Logger

Expand Down Expand Up @@ -102,6 +102,15 @@ defmodule Archethic.SelfRepair.RepairWorker do

def handle_info(_, data), do: {:noreply, data}

# kill the repair worker because they do not know about the genesis address
def code_change(1, state, _extra) do
me = self()
Task.start(fn -> Process.exit(me, :kill) end)
{:ok, state}
end

def code_change(_version, state, _extra), do: {:ok, state}

defp start_repair(
data = %{
storage_addresses: [],
Expand Down

0 comments on commit 5cdcb71

Please sign in to comment.