wip heartbeat stuff

This commit is contained in:
Luuk van Oijen
2023-11-20 09:34:00 +01:00
parent 4bf4727cc3
commit 7c82f474bb
3 changed files with 6 additions and 2 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
/target
ServerConfig.toml

View File

@@ -100,12 +100,15 @@ async fn backend_heartbeat(config: std::sync::Arc<config::Config>) {
}
async fn heartbeat_post(heartbeat_info: &HeartbeatInfo) {
if let Err(e) = reqwest::Client::new()
match reqwest::Client::new()
.post("https://backend.beammp.com/heartbeat")
.form(heartbeat_info)
.send()
.await
{
error!("Heartbeat error occured: {e}");
Ok(resp) => {
debug!("heartbeat response:\n{:?}", resp.text().await);
},
Err(e) => error!("Heartbeat error occured: {e}"),
}
}