Skip to content

Commit 5a3c308

Browse files
committed
Remove dead flush_all_imports function
1 parent 06c6c78 commit 5a3c308

1 file changed

Lines changed: 0 additions & 34 deletions

File tree

src/py_context_router.erl

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@
7676
start_pool/3,
7777
stop_pool/1,
7878
pool_started/1,
79-
%% Import cache management
80-
flush_all_imports/1,
8179
%% Pool registration (route module/func to specific pools)
8280
register_pool/2,
8381
register_pool/3,
@@ -381,38 +379,6 @@ pool_started(Pool) when is_atom(Pool) ->
381379
end
382380
end.
383381

384-
%% @doc Flush import caches from all contexts in all pools.
385-
%%
386-
%% Iterates through all pools (default and registered) and removes
387-
%% specified modules from sys.modules in each context's interpreter.
388-
%%
389-
%% @param Modules List of module names (binaries) to remove
390-
%% @returns ok
391-
-spec flush_all_imports([binary()]) -> ok.
392-
flush_all_imports(Modules) ->
393-
%% Get all pool names from the registry
394-
RegisteredPools = case persistent_term:get(?POOL_REGISTRY_KEY, undefined) of
395-
undefined -> [];
396-
Registry when is_map(Registry) ->
397-
%% Extract unique pool names from registry values
398-
lists:usort(maps:values(Registry))
399-
end,
400-
%% Always include default pool, plus any registered pools
401-
AllPools = lists:usort([default | RegisteredPools]),
402-
%% Flush each pool
403-
lists:foreach(fun(Pool) ->
404-
case pool_started(Pool) of
405-
true ->
406-
Ctxs = contexts(Pool),
407-
lists:foreach(fun(Ctx) ->
408-
catch py_context:flush_imports(Ctx, Modules)
409-
end, Ctxs);
410-
false ->
411-
ok
412-
end
413-
end, AllPools),
414-
ok.
415-
416382
%% ============================================================================
417383
%% Pool Registration (route module/func to specific pools)
418384
%% ============================================================================

0 commit comments

Comments
 (0)