mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-10-25 13:30:43 +00:00
now it updates whenever new data is ready
This commit is contained in:
1 parent
0e75a35c83
commit
7d0941dee8
1 file changed
+9
-6
+9
-6
@@ -41,12 +41,15 @@ pub async fn backend_heartbeat(config: std::sync::Arc<crate::config::Config>, mu
|
|||||||
loop {
|
loop {
|
||||||
interval.tick().await;
|
interval.tick().await;
|
||||||
|
|
||||||
heartbeat_post(&info).await;
|
tokio::select! {
|
||||||
|
_ = heartbeat_post(&info) => {}
|
||||||
if let Ok(status) = hb_rx.try_recv() {
|
status = hb_rx.recv() => {
|
||||||
trace!("status update: {:?}", status);
|
if let Some(status) = status {
|
||||||
info.players = status.player_count;
|
trace!("status update: {:?}", status);
|
||||||
info.playerslist = status.player_list.clone();
|
info.players = status.player_count;
|
||||||
|
info.playerslist = status.player_list.clone();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user