Skip to content

Commit 6ecb430

Browse files
committed
Do not purge on recompile if IEx is not running, closes #14260
1 parent b615c84 commit 6ecb430

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
@@ -12,10 +12,18 @@ defmodule IEx.MixListener do
1212

1313
@doc """
1414
Unloads all modules invalidated by external compilations.
15+
16+
Returns `:noop` if there is no module to purge or if
17+
the listener is not running (it may happen when connecting
18+
via --remsh to a node that was started without IEx).
1519
"""
1620
@spec purge :: :ok | :noop
1721
def purge do
18-
GenServer.call(@name, :purge, :infinity)
22+
if Process.whereis(@name) do
23+
GenServer.call(@name, :purge, :infinity)
24+
else
25+
:noop
26+
end
1927
end
2028

2129
@impl true

0 commit comments

Comments
 (0)