Skip to content

Commit 6e6ed6a

Browse files
committed
Only return purgeable modules back to pool
1 parent 0ea809e commit 6e6ed6a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/elixir/src/elixir_code_server.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ handle_call(retrieve_compiler_module, _From, Config) ->
7070
handle_call(purge_compiler_modules, _From, Config) ->
7171
{Used, Unused, Counter} = Config#elixir_code_server.mod_pool,
7272
purge_used(Used),
73-
Mods = lists:map(fun({Mod, _}) -> Mod end, Used),
73+
Mods = [Mod || {Mod, Purgeable} <- Used, Purgeable],
7474
ModPool = {[], Mods ++ Unused, Counter},
7575
{reply, {ok, length(Used)}, Config#elixir_code_server{mod_pool=ModPool}};
7676

@@ -112,7 +112,7 @@ handle_cast(purge_compiler_modules, Config) ->
112112
%% purge them asynchronously, especially because they can
113113
%% block the code server. Ideally we would purge them in
114114
%% batches, but that's not supported at the moment.
115-
Mods = lists:map(fun({Mod, _}) -> Mod end, Used),
115+
Mods = [Mod || {Mod, Purgeable} <- Used, Purgeable],
116116
Opts = [{monitor, [{tag, {purged, Mods}}]}],
117117
erlang:spawn_opt(fun() -> purge_used(Used) end, Opts)
118118
end,

0 commit comments

Comments
 (0)