diff --git a/lib_cache/current_cache.ml b/lib_cache/current_cache.ml index 2b43a6a4..e327d134 100644 --- a/lib_cache/current_cache.ml +++ b/lib_cache/current_cache.ml @@ -583,6 +583,9 @@ module S = S module Db = struct include Db + let key ~job_id = + lookup_job_id job_id |> Option.map snd + let history ~limit ~job_id = let key = match Hashtbl.find_opt key_of_job_id job_id with diff --git a/lib_cache/current_cache.mli b/lib_cache/current_cache.mli index 5ac1b8bc..6e29264e 100644 --- a/lib_cache/current_cache.mli +++ b/lib_cache/current_cache.mli @@ -77,4 +77,7 @@ module Db : sig val history : limit:int -> job_id:string -> string option * entry list (** [history ~limit ~job_id] returns the in-progress build (if any), and the [limit] most recent builds with the same key as [job_id]. *) + + val key : job_id:string -> string option + (** [key ~job_id] returns the serialised key associated with the job [job_id] if any. *) end