@@ -185,27 +185,19 @@ defmodule Module.ParallelChecker do
185
185
{ checker , :gen_server . call ( checker , :ets , :infinity ) }
186
186
end
187
187
188
- @ doc """
189
- Preloads a module into the cache. Call this function before any other
190
- cache lookups for the module.
191
- """
192
- @ spec preload_module ( cache ( ) , module ( ) ) :: :ok
193
- def preload_module ( { server , ets } , module ) do
194
- case :ets . lookup ( ets , { :cached , module } ) do
195
- [ { _key , _ } ] -> :ok
196
- [ ] -> cache_module ( { server , ets } , module )
197
- end
198
- end
199
-
200
188
@ doc """
201
189
Returns the export kind and deprecation reason for the given MFA from
202
190
the cache. If the module does not exist return `{:error, :module}`,
203
191
or if the function does not exist return `{:error, :function}`.
204
192
"""
205
193
@ spec fetch_export ( cache ( ) , module ( ) , atom ( ) , arity ( ) ) ::
206
194
{ :ok , mode ( ) , kind ( ) , binary ( ) | nil } | { :error , :function | :module }
207
- def fetch_export ( { _server , ets } , module , fun , arity ) do
195
+ def fetch_export ( { server , ets } , module , fun , arity ) do
208
196
case :ets . lookup ( ets , { :cached , module } ) do
197
+ [ ] ->
198
+ cache_module ( { server , ets } , module )
199
+ fetch_export ( { server , ets } , module , fun , arity )
200
+
209
201
[ { _key , false } ] ->
210
202
{ :error , :module }
211
203
0 commit comments