Skip to content

Commit

Permalink
Remove :inets.stop
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmanzanera committed Dec 9, 2022
1 parent e3e5d6e commit 8093ee8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/archethic/networking/ip_lookup/remote_discovery/ipify.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions rel/appups/archethic/1.0.0_to_1.0.1.appup
Original file line number Diff line number Diff line change
@@ -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', []}]}]
}.

0 comments on commit 8093ee8

Please sign in to comment.