Prevalidator: log_debug canceled operation fetches

This commit is contained in:
Benjamin Canou 2017-11-10 09:56:40 +01:00 committed by Grégoire
parent d5a2bd9604
commit 602a10651c

View File

@ -243,10 +243,18 @@ let create net_db =
let fetch op =
Distributed_db.Operation.fetch
~timeout:10. (* TODO allow to adjust the constant ... *)
net_db ~peer:gid op () >>= fun _op ->
push_to_worker (`Handle op) ;
Lwt.return_unit
in
net_db ~peer:gid op () >>= function
| Ok _op ->
push_to_worker (`Handle op) ;
Lwt.return_unit
| Error [ Distributed_db.Operation.Canceled _ ] ->
lwt_debug
"operation %a included before being prevalidated"
Operation_hash.pp_short op >>= fun () ->
Lwt.return_unit
| Error _ ->
(* should not happen *)
Lwt.return_unit in
List.iter
(fun op -> Operation_hash.Table.add pending op (fetch op))
unknown_ops ;