@@ -185,27 +185,19 @@ defmodule Module.ParallelChecker do
185185 { checker , :gen_server . call ( checker , :ets , :infinity ) }
186186 end
187187
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-
200188 @ doc """
201189 Returns the export kind and deprecation reason for the given MFA from
202190 the cache. If the module does not exist return `{:error, :module}`,
203191 or if the function does not exist return `{:error, :function}`.
204192 """
205193 @ spec fetch_export ( cache ( ) , module ( ) , atom ( ) , arity ( ) ) ::
206194 { :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
208196 case :ets . lookup ( ets , { :cached , module } ) do
197+ [ ] ->
198+ cache_module ( { server , ets } , module )
199+ fetch_export ( { server , ets } , module , fun , arity )
200+
209201 [ { _key , false } ] ->
210202 { :error , :module }
211203
0 commit comments