Skip to content

Commit

Permalink
Allow users to get serialised key of job
Browse files Browse the repository at this point in the history
  • Loading branch information
patricoferris authored and shonfeder committed Jul 28, 2024
1 parent ca5976f commit d57b358
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib_cache/current_cache.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib_cache/current_cache.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d57b358

Please sign in to comment.