mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2024-11-16 15:27:46 +00:00
feat: better error output if request for xmrig fail
This commit is contained in:
parent
307a8b5dba
commit
e9d8d37ad2
1 changed files with 12 additions and 11 deletions
|
@ -617,16 +617,17 @@ impl Helper {
|
||||||
);
|
);
|
||||||
// Send an HTTP API request
|
// Send an HTTP API request
|
||||||
debug!("XMRig Watchdog | Attempting HTTP API request...");
|
debug!("XMRig Watchdog | Attempting HTTP API request...");
|
||||||
if let Ok(priv_api) =
|
match PrivXmrigApi::request_xmrig_api(client.clone(), &api_uri, token).await {
|
||||||
PrivXmrigApi::request_xmrig_api(client.clone(), &api_uri, token).await
|
Ok(priv_api) => {
|
||||||
{
|
debug!("XMRig Watchdog | HTTP API request OK, attempting [update_from_priv()]");
|
||||||
debug!("XMRig Watchdog | HTTP API request OK, attempting [update_from_priv()]");
|
PubXmrigApi::update_from_priv(&pub_api, priv_api);
|
||||||
PubXmrigApi::update_from_priv(&pub_api, priv_api);
|
}
|
||||||
} else {
|
Err(err) => {
|
||||||
warn!(
|
warn!(
|
||||||
"XMRig Watchdog | Could not send HTTP API request to: {}",
|
"XMRig Watchdog | Could not send HTTP API request to: {}\n{}",
|
||||||
api_uri
|
api_uri, err
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sleep (only if 900ms hasn't passed)
|
// Sleep (only if 900ms hasn't passed)
|
||||||
|
@ -811,7 +812,7 @@ impl PrivXmrigApi {
|
||||||
.uri(api_uri)
|
.uri(api_uri)
|
||||||
.body(hyper::Body::empty())?;
|
.body(hyper::Body::empty())?;
|
||||||
let response = tokio::time::timeout(
|
let response = tokio::time::timeout(
|
||||||
std::time::Duration::from_millis(500),
|
std::time::Duration::from_millis(5000),
|
||||||
client.request(request),
|
client.request(request),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
Loading…
Reference in a new issue