This commit is contained in:
parent
e8d7b413ad
commit
932f4da38b
5 changed files with 8 additions and 8 deletions
|
|
@ -63,7 +63,7 @@ module Make (Conn : Pg.CONN) (Fs : Fat.FS) : S = struct
|
|||
())
|
||||
|
||||
let signkeys () : Signkey.t list result =
|
||||
let now = Timestamp.of_ptime @@ Ptime_clock.now () in
|
||||
let now = Timestamp.of_ptime @@ Mirage_ptime.now () in
|
||||
let+ l = Pg.get_signkeys conn ~now |> unwrap_caqti in
|
||||
let missing_l, l =
|
||||
List.partition
|
||||
|
|
@ -198,7 +198,7 @@ module Make (Conn : Pg.CONN) (Fs : Fat.FS) : S = struct
|
|||
Ok future_dn
|
||||
|
||||
let make_future_keys_response () =
|
||||
let now = Timestamp.of_ptime @@ Ptime_clock.now () in
|
||||
let now = Timestamp.of_ptime @@ Mirage_ptime.now () in
|
||||
(* get keys from database to filter out keys already certified *)
|
||||
let* sk_db_l = Pg.get_signkeys conn ~now |> unwrap_caqti in
|
||||
let sk_ht = Hashtbl.create 0xff in
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ let mk_keys ~db_conn (module Keys : Keys.S) ~last_issue_date =
|
|||
|
||||
(* the eddsa pub key used to sign exchange_sig *)
|
||||
let* exchange_pub =
|
||||
let now = Timestamp.of_ptime (Ptime_clock.now ()) in
|
||||
let now = Timestamp.of_ptime (Mirage_ptime.now ()) in
|
||||
let opt =
|
||||
List.find_opt (fun sk -> Signkey.is_valid_at ~timestamp:now sk) signkeys
|
||||
in
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ let init fs =
|
|||
let ht = Hashtbl.create 0xff in
|
||||
Ok { fs; sm_key_priv; sm_pub; ht }
|
||||
in
|
||||
let now = TimeAbsolute.of_ptime (Ptime_clock.now ()) in
|
||||
let now = TimeAbsolute.of_ptime (Mirage_ptime.now ()) in
|
||||
let keys = List.of_seq @@ Hashtbl.to_seq_values t.ht in
|
||||
let new_keys = gen_additional_keys_until_lookahead ~now keys in
|
||||
List.iter (fun k -> Hashtbl.replace t.ht k.pub k) new_keys;
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ let load fs =
|
|||
|
||||
let init fs =
|
||||
let* opt = load fs in
|
||||
let now = TimeAbsolute.of_ptime (Ptime_clock.now ()) in
|
||||
let now = TimeAbsolute.of_ptime (Mirage_ptime.now ()) in
|
||||
let* t =
|
||||
match opt with
|
||||
| Some t -> Ok t
|
||||
|
|
@ -262,7 +262,7 @@ module Make (Fs : Fat.FS) = struct
|
|||
|> list_iter delete
|
||||
|
||||
let add section_name t1 t2 =
|
||||
let last_change = Timestamp.of_ptime (Ptime_clock.now ()) in
|
||||
let last_change = Timestamp.of_ptime (Mirage_ptime.now ()) in
|
||||
let k = gen_key ~section_name t1 t2 in
|
||||
let+ () = write_key t.fs k in
|
||||
Hashtbl.replace t.ht k.h_pub k;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ module Log_reporter = struct
|
|||
Logs.Tag.def "Detail tag" ~doc:"" Fmt.string
|
||||
|
||||
let detail s = Logs.Tag.(empty |> add detail_tag s)
|
||||
let time_anchor = Ptime_clock.now () |> Ptime.to_span
|
||||
let time_anchor = Mirage_ptime.now () |> Ptime.to_span
|
||||
|
||||
let color_of_log_level = function
|
||||
| Logs.App -> `White
|
||||
|
|
@ -35,7 +35,7 @@ module Log_reporter = struct
|
|||
let with_detail h tags k user_fmt =
|
||||
let detail = Option.bind tags (Logs.Tag.find detail_tag) in
|
||||
let timestamp =
|
||||
Ptime.sub_span (Ptime_clock.now ()) time_anchor
|
||||
Ptime.sub_span (Mirage_ptime.now ()) time_anchor
|
||||
|> Option.map Ptime.to_float_s
|
||||
|> Option.value ~default:0.
|
||||
in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue