Shell: improve termination

Kill the `DistributedDB` before anything else.
This commit is contained in:
Grégoire Henry 2019-02-20 15:34:46 +01:00
parent 359f2d6932
commit c80ab66397
No known key found for this signature in database
GPG Key ID: 50D984F20BD445D2
2 changed files with 2 additions and 2 deletions

View File

@ -910,7 +910,7 @@ let disconnect { global_db = { p2p } } peer_id =
| None -> Lwt.return_unit
| Some conn -> P2p.disconnect p2p conn
let shutdown { p2p ; p2p_readers ; active_chains } =
let shutdown { p2p_readers ; active_chains } =
P2p_peer.Table.fold
(fun _peer_id reader acc ->
P2p_reader.shutdown reader >>= fun () -> acc)
@ -923,7 +923,6 @@ let shutdown { p2p ; p2p_readers ; active_chains } =
acc)
active_chains
Lwt.return_unit >>= fun () ->
P2p.shutdown p2p >>= fun () ->
Lwt.return_unit
let clear_block chain_db hash n =

View File

@ -205,6 +205,7 @@ let create
?max_child_ttl ~start_prevalidator mainchain_state >>=? fun mainchain_validator ->
let shutdown () =
P2p.shutdown p2p >>= fun () ->
Distributed_db.shutdown distributed_db >>= fun () ->
Validator.shutdown validator >>= fun () ->
State.close state >>= fun () ->
Lwt.return_unit