mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 02:48:03 +00:00
Split the telemetry net status report in two (#3887)
* Split the telemetry net status report in two * Update core/service/src/lib.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Remove clone() * Move code to status_sinks.rs instead * Add basic usage for status_sinks * Update core/service/src/status_sinks.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
committed by
Gavin Wood
parent
eabdcbdd4f
commit
a6a60d77ba
@@ -22,6 +22,7 @@ use futures03::{StreamExt as _, TryStreamExt as _};
|
||||
use log::{info, warn};
|
||||
use sr_primitives::traits::Header;
|
||||
use service::AbstractService;
|
||||
use std::time::Duration;
|
||||
|
||||
mod display;
|
||||
|
||||
@@ -31,11 +32,13 @@ pub fn build(service: &impl AbstractService) -> impl Future<Item = (), Error = (
|
||||
|
||||
let mut display = display::InformantDisplay::new();
|
||||
|
||||
let display_notifications = service.network_status().for_each(move |(net_status, _)| {
|
||||
let info = client.info();
|
||||
display.display(&info, net_status);
|
||||
Ok(())
|
||||
});
|
||||
let display_notifications = service
|
||||
.network_status(Duration::from_millis(5000))
|
||||
.for_each(move |(net_status, _)| {
|
||||
let info = client.info();
|
||||
display.display(&info, net_status);
|
||||
Ok(())
|
||||
});
|
||||
|
||||
let client = service.client();
|
||||
let mut last_best = {
|
||||
|
||||
Reference in New Issue
Block a user