Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log when adding block #10310

Merged
merged 4 commits into from
Mar 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/app/archive/archive_lib/processor.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2023,9 +2023,12 @@ let add_block_aux ?(retries = 3) ~logger ~add_block ~hash ~delete_older_than
let add () =
Caqti_async.Pool.use
(fun (module Conn : CONNECTION) ->
let%bind res =
let%bind res =
let open Deferred.Result.Let_syntax in
let%bind () = Conn.start () in
[%log info] "Attempting to add block data for $state_hash"
~metadata:
[("state_hash", Mina_base.State_hash.to_yojson (hash block))];
let%bind block_id = add_block (module Conn : CONNECTION) block in
(* if an existing block has a parent hash that's for the block just added,
set its parent id
Expand Down Expand Up @@ -2058,8 +2061,8 @@ let add_block_aux ?(retries = 3) ~logger ~add_block ~hash ~delete_older_than
| Ok _ ->
[%log info] "Committing block data for $state_hash"
~metadata:
[("state_hash", Mina_base.State_hash.to_yojson (hash block))] ;
Conn.commit () )
[ ("state_hash", Mina_base.State_hash.to_yojson (hash block)) ] ;
Conn.commit ())
pool
in
retry ~f:add ~logger ~error_str:"add_block_aux" retries
Expand Down