From 8093ee8d6f3878b2969a88eaadb2fffdef1283a8 Mon Sep 17 00:00:00 2001 From: Samuel Manzanera Date: Fri, 9 Dec 2022 16:55:36 +0100 Subject: [PATCH] Remove :inets.stop --- .../networking/ip_lookup/remote_discovery/ipify.ex | 7 +++++-- mix.exs | 2 +- rel/appups/archethic/1.0.0_to_1.0.1.appup | 6 ++++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 rel/appups/archethic/1.0.0_to_1.0.1.appup diff --git a/lib/archethic/networking/ip_lookup/remote_discovery/ipify.ex b/lib/archethic/networking/ip_lookup/remote_discovery/ipify.ex index 923e94873..4d8033846 100644 --- a/lib/archethic/networking/ip_lookup/remote_discovery/ipify.ex +++ b/lib/archethic/networking/ip_lookup/remote_discovery/ipify.ex @@ -8,7 +8,8 @@ defmodule Archethic.Networking.IPLookup.RemoteDiscovery.IPIFY do @behaviour Impl @impl Impl - @spec get_node_ip() :: {:ok, :inet.ip_address()} | {:error, :not_recognizable_ip} + @spec get_node_ip() :: + {:ok, :inet.ip_address()} | {:error, :not_recognizable_ip} | {:error, any()} def get_node_ip() do with {:ok, {_, _, inet_addr}} <- :httpc.request('http://api.ipify.org'), {:ok, ip} <- :inet.parse_address(inet_addr) do @@ -18,8 +19,10 @@ defmodule Archethic.Networking.IPLookup.RemoteDiscovery.IPIFY do {:error, :not_recognizable_ip} {:error, :einval} -> - :inets.stop() {:error, :not_recognizable_ip} + + {:error, _} = e -> + e end end end diff --git a/mix.exs b/mix.exs index 3886cd7f6..0f24a7b06 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Archethic.MixProject do def project do [ app: :archethic, - version: "1.0.0", + version: "1.0.1", build_path: "_build", config_path: "config/config.exs", deps_path: "deps", diff --git a/rel/appups/archethic/1.0.0_to_1.0.1.appup b/rel/appups/archethic/1.0.0_to_1.0.1.appup new file mode 100644 index 000000000..16a7f8dd9 --- /dev/null +++ b/rel/appups/archethic/1.0.0_to_1.0.1.appup @@ -0,0 +1,6 @@ +{"1.0.1", + [{"1.0.0", + [{load_module,'Elixir.Archethic.Networking.IPLookup.RemoteDiscovery.IPIFY', []}]}], + [{"1.0.0", + [{load_module,'Elixir.Archethic.Networking.IPLookup.RemoteDiscovery.IPIFY', []}]}] +}.