Skip to content

Commit 34997a2

Browse files
committed
Do not purge on recompile if IEx is not running, closes #14260
1 parent e45a1f2 commit 34997a2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/iex/lib/iex/mix_listener.ex

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,18 @@ defmodule IEx.MixListener do
1515

1616
@doc """
1717
Unloads all modules invalidated by external compilations.
18+
19+
Returns `:noop` if there is no module to purge or if
20+
the listener is not running (it may happen when connecting
21+
via --remsh to a node that was started without IEx).
1822
"""
1923
@spec purge :: :ok | :noop
2024
def purge do
21-
GenServer.call(@name, :purge, :infinity)
25+
if Process.whereis(@name) do
26+
GenServer.call(@name, :purge, :infinity)
27+
else
28+
:noop
29+
end
2230
end
2331

2432
@impl true

0 commit comments

Comments
 (0)