@@ -66,14 +66,17 @@ path(ProcID, Ref, PathSuffix, Opts) ->
6666latest (ProcID , Opts ) -> latest (ProcID , [], Opts ).
6767latest (ProcID , RequiredPath , Opts ) ->
6868 latest (ProcID , RequiredPath , undefined , Opts ).
69- latest (ProcID , RawRequiredPath , Limit , Opts ) ->
70- ? event (
71- {latest_called ,
72- {proc_id , ProcID },
73- {required_path , RawRequiredPath },
74- {limit , Limit }
75- }
76- ),
69+ latest (ProcID , RawRequiredPath , Limit , RawOpts ) ->
70+ Scope = hb_opts :get (process_cache_scope , local , RawOpts ),
71+ % Normalize the store descriptor to a list of stores.
72+ UnscopedStore =
73+ case hb_opts :get (store , no_viable_store , RawOpts ) of
74+ StoreMsg when is_map (StoreMsg ) -> [StoreMsg ];
75+ Other -> Other
76+ end ,
77+ % Apply the scope to the store and update the options message.
78+ ScopedStore = hb_store :scope (UnscopedStore , Scope ),
79+ Opts = RawOpts #{ store => ScopedStore },
7780 % Convert the required path to a list of _binary_ keys.
7881 RequiredPath =
7982 case RawRequiredPath of
0 commit comments