Skip to content

Commit

Permalink
Merge pull request #10310 from MinaProtocol/feature/add-block-log
Browse files Browse the repository at this point in the history
  • Loading branch information
psteckler committed Mar 1, 2022
2 parents 089cf2b + c6fa9c4 commit b816f01
Showing 1 changed file with 6 additions and 3 deletions.
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

0 comments on commit b816f01

Please sign in to comment.