Skip to content

Commit

Permalink
Do not purge on recompile if IEx is not running, closes #14260
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Feb 12, 2025
1 parent e45a1f2 commit 34997a2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/iex/lib/iex/mix_listener.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ defmodule IEx.MixListener do

@doc """
Unloads all modules invalidated by external compilations.
Returns `:noop` if there is no module to purge or if
the listener is not running (it may happen when connecting
via --remsh to a node that was started without IEx).
"""
@spec purge :: :ok | :noop
def purge do
GenServer.call(@name, :purge, :infinity)
if Process.whereis(@name) do
GenServer.call(@name, :purge, :infinity)
else
:noop
end
end

@impl true
Expand Down

0 comments on commit 34997a2

Please sign in to comment.