diff --git a/lib/archethic/bootstrap.ex b/lib/archethic/bootstrap.ex index 7a36dcf291..0b29b0ea80 100644 --- a/lib/archethic/bootstrap.ex +++ b/lib/archethic/bootstrap.ex @@ -220,11 +220,8 @@ defmodule Archethic.Bootstrap do nodes = Archethic.P2P.authorized_and_available_nodes() Logger.debug("Resync Starting") - Archethic.Utils.async_no_link_pmap( - type_list, - &fn type = &1 -> - Logger.debug("Resync #{type}") - + Enum.each(type_list, fn type -> + Task.Supervisor.async_nolink(Archethic.TaskSupervisor, fn -> try do TransactionChain.list_addresses_by_type(type) |> Enum.at(0) @@ -237,14 +234,16 @@ defmodule Archethic.Bootstrap do :ok rescue error -> - Logger.debug("Resync of chain #{type} failed #{error} ") + Logger.debug("Resync Nodes did not respond", error: error) + :ok end - end - ) + end) + end) rescue error -> - Logger.debug("Resync failed nodes NA. #{error}") + Logger.debug("Resync Failed - Nodes N/A ", error: error) + :ok end end diff --git a/lib/archethic/utils.ex b/lib/archethic/utils.ex index 5b8821c637..cff2a669c3 100644 --- a/lib/archethic/utils.ex +++ b/lib/archethic/utils.ex @@ -680,11 +680,4 @@ defmodule Archethic.Utils do end) end) end - - @spec async_no_link_pmap(any, any) :: list - def async_no_link_pmap(collection, func) do - collection - |> Enum.map(&Task.Supervisor.async_nolink(Archethic.TaskSupervisor, fn -> func.(&1) end)) - |> Task.await_many() - end end