src/bin/proxmox-backup-proxy.rs: use block_in_place for rrd update

This commit is contained in:
Dietmar Maurer 2020-05-25 08:30:59 +02:00
parent 736edc7a7e
commit 4f9513996c

View File

@ -605,6 +605,8 @@ async fn generate_host_stats() {
read_meminfo, read_proc_stat, read_proc_net_dev}; read_meminfo, read_proc_stat, read_proc_net_dev};
use proxmox_backup::rrd; use proxmox_backup::rrd;
proxmox_backup::tools::runtime::block_in_place(move || {
match read_proc_stat() { match read_proc_stat() {
Ok(stat) => { Ok(stat) => {
if let Err(err) = rrd::update_value("host/cpu", stat.cpu, rrd::DST::Gauge) { if let Err(err) = rrd::update_value("host/cpu", stat.cpu, rrd::DST::Gauge) {
@ -650,5 +652,5 @@ async fn generate_host_stats() {
eprintln!("read_prox_net_dev failed - {}", err); eprintln!("read_prox_net_dev failed - {}", err);
} }
} }
});
} }