Minor monitoring tweaks

This commit is contained in:
timvisee 2021-11-22 17:57:44 +01:00
parent f95682fcd5
commit 723ebabcfb
No known key found for this signature in database
GPG Key ID: B8DB720BC383E172

View File

@ -27,7 +27,7 @@ const MONITOR_POLL_INTERVAL: Duration = Duration::from_secs(2);
const STATUS_TIMEOUT: u64 = 20;
/// Ping request timeout in seconds.
const PING_TIMEOUT: u64 = 20;
const PING_TIMEOUT: u64 = 10;
/// Monitor server.
pub async fn monitor_server(config: Arc<Config>, server: Arc<Server>) {
@ -87,6 +87,7 @@ pub async fn poll_server(
// Try ping fallback if server is currently started
if server.state() == State::Started {
debug!(target: "lazymc::monitor", "Failed to get status from started server, trying ping...");
do_ping(config, addr).await?;
}