Skip to content

Commit 91e94ce

Browse files
committed
Rename file
1 parent 9708e77 commit 91e94ce

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lib/mix/lib/mix/tasks/deps.parallel.ex renamed to lib/mix/lib/mix/tasks/deps.partition.ex

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ defmodule Mix.Tasks.Deps.Partition do
6161
%{port: port, index: index, socket: client}
6262

6363
error ->
64-
raise """
64+
Mix.raise("""
6565
could not start partition dependency compiler, no connection made to TCP port: #{inspect(error)}
6666
6767
The spawned operating system process wrote the following output:
6868
#{close_port(port, "")}
69-
"""
69+
""")
7070
end
7171
end)
7272

@@ -117,14 +117,11 @@ defmodule Mix.Tasks.Deps.Partition do
117117

118118
{:tcp_closed, socket} ->
119119
shutdown_clients(available ++ busy)
120-
Mix.shell().error("ERROR! mix deps.partition #{inspect(socket)} closed unexpectedly")
120+
Mix.raise("ERROR! mix deps.partition #{inspect(socket)} closed unexpectedly")
121121

122122
{:tcp_error, socket, error} ->
123123
shutdown_clients(available ++ busy)
124-
125-
Mix.shell().error(
126-
"ERROR! mix deps.partition #{inspect(socket)} errored: #{inspect(error)}"
127-
)
124+
Mix.raise("ERROR! mix deps.partition #{inspect(socket)} errored: #{inspect(error)}")
128125

129126
{port, {:data, {eol, data}}} ->
130127
with %{index: index} <-
@@ -186,8 +183,12 @@ defmodule Mix.Tasks.Deps.Partition do
186183
{:ok, socket} =
187184
:gen_tcp.connect(String.to_charlist(host), port, [:binary, packet: :line, active: false])
188185

189-
deps = Mix.Dep.load_and_cache()
190-
client_loop(socket, deps, force?, Mix.Project.deps_config())
186+
try do
187+
deps = Mix.Dep.load_and_cache()
188+
client_loop(socket, deps, force?, Mix.Project.deps_config())
189+
after
190+
:gen_tcp.close(socket)
191+
end
191192
end
192193

193194
def client_loop(socket, deps, force?, config) do

0 commit comments

Comments
 (0)